Big diff: Use new "|" union syntax (#5872)

This commit is contained in:
Akuli
2021-08-08 12:05:21 +03:00
committed by GitHub
parent b9adb7a874
commit ee487304d7
578 changed files with 8080 additions and 8966 deletions

View File

@@ -1,13 +1,13 @@
import sys
from _typeshed import Self, StrOrBytesPath
from typing import IO, Any, AnyStr, Callable, Generic, Iterable, Iterator, Union
from typing import IO, Any, AnyStr, Callable, Generic, Iterable, Iterator
if sys.version_info >= (3, 9):
from types import GenericAlias
if sys.version_info >= (3, 10):
def input(
files: Union[StrOrBytesPath, Iterable[StrOrBytesPath], None] = ...,
files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ...,
inplace: bool = ...,
backup: str = ...,
*,
@@ -19,7 +19,7 @@ if sys.version_info >= (3, 10):
elif sys.version_info >= (3, 8):
def input(
files: Union[StrOrBytesPath, Iterable[StrOrBytesPath], None] = ...,
files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ...,
inplace: bool = ...,
backup: str = ...,
*,
@@ -29,7 +29,7 @@ elif sys.version_info >= (3, 8):
else:
def input(
files: Union[StrOrBytesPath, Iterable[StrOrBytesPath], None] = ...,
files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ...,
inplace: bool = ...,
backup: str = ...,
bufsize: int = ...,
@@ -50,7 +50,7 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]):
if sys.version_info >= (3, 10):
def __init__(
self,
files: Union[None, StrOrBytesPath, Iterable[StrOrBytesPath]] = ...,
files: None | StrOrBytesPath | Iterable[StrOrBytesPath] = ...,
inplace: bool = ...,
backup: str = ...,
*,
@@ -62,7 +62,7 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]):
elif sys.version_info >= (3, 8):
def __init__(
self,
files: Union[None, StrOrBytesPath, Iterable[StrOrBytesPath]] = ...,
files: None | StrOrBytesPath | Iterable[StrOrBytesPath] = ...,
inplace: bool = ...,
backup: str = ...,
*,
@@ -72,7 +72,7 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]):
else:
def __init__(
self,
files: Union[None, StrOrBytesPath, Iterable[StrOrBytesPath]] = ...,
files: None | StrOrBytesPath | Iterable[StrOrBytesPath] = ...,
inplace: bool = ...,
backup: str = ...,
bufsize: int = ...,