Switch to PEP-604 syntax in python2 stubs (#5915)

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
Oleg Höfling
2021-08-14 11:12:30 +02:00
committed by GitHub
parent 431c4f7fc1
commit ff63953188
235 changed files with 2473 additions and 2768 deletions

View File

@@ -1,5 +1,5 @@
from abc import ABCMeta
from typing import IO, Iterable, Iterator, List, Optional, Union, overload
from typing import IO, Iterable, Iterator, List, overload
# This class isn't actually abstract, but you can't instantiate it
# directly, so we might as well treat it as abstract in the stub.
@@ -15,7 +15,7 @@ class InputType(IO[str], Iterator[str], metaclass=ABCMeta):
def readlines(self, hint: int = ...) -> List[str]: ...
def seek(self, offset: int, whence: int = ...) -> int: ...
def tell(self) -> int: ...
def truncate(self, size: Optional[int] = ...) -> int: ...
def truncate(self, size: int | None = ...) -> int: ...
def __iter__(self) -> InputType: ...
def next(self) -> str: ...
def reset(self) -> None: ...
@@ -34,12 +34,12 @@ class OutputType(IO[str], Iterator[str], metaclass=ABCMeta):
def readlines(self, hint: int = ...) -> List[str]: ...
def seek(self, offset: int, whence: int = ...) -> int: ...
def tell(self) -> int: ...
def truncate(self, size: Optional[int] = ...) -> int: ...
def truncate(self, size: int | None = ...) -> int: ...
def __iter__(self) -> OutputType: ...
def next(self) -> str: ...
def reset(self) -> None: ...
def write(self, b: Union[str, unicode]) -> int: ...
def writelines(self, lines: Iterable[Union[str, unicode]]) -> None: ...
def write(self, b: str | unicode) -> int: ...
def writelines(self, lines: Iterable[str | unicode]) -> None: ...
@overload
def StringIO() -> OutputType: ...