Fix return annotations of several methods that return self at runtime (#7070)

This commit is contained in:
Alex Waygood
2022-01-29 01:37:49 +00:00
committed by GitHub
parent 749d3db815
commit 33ecb68603
8 changed files with 19 additions and 15 deletions

View File

@@ -46,7 +46,7 @@ def fileno() -> int: ...
def isfirstline() -> bool: ...
def isstdin() -> bool: ...
class FileInput(Iterable[AnyStr], Generic[AnyStr]):
class FileInput(Iterator[AnyStr], Generic[AnyStr]):
if sys.version_info >= (3, 10):
def __init__(
self,
@@ -83,7 +83,7 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]):
def close(self) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ...
def __iter__(self) -> Iterator[AnyStr]: ...
def __iter__(self: Self) -> Self: ...
def __next__(self) -> AnyStr: ...
if sys.version_info < (3, 11):
def __getitem__(self, i: int) -> AnyStr: ...