Use _typeshed.Self with __enter__ (#5712)

This commit is contained in:
Anton Grübel
2021-06-30 00:19:25 +02:00
committed by GitHub
parent 35cc7491db
commit c38171a0b3
8 changed files with 24 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
import sys
from _typeshed import StrOrBytesPath
from _typeshed import Self, StrOrBytesPath
from typing import IO, Any, AnyStr, Callable, Generic, Iterable, Iterator, Union
if sys.version_info >= (3, 10):
@@ -78,7 +78,7 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]):
) -> None: ...
def __del__(self) -> None: ...
def close(self) -> None: ...
def __enter__(self) -> FileInput[AnyStr]: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ...
def __iter__(self) -> Iterator[AnyStr]: ...
def __next__(self) -> AnyStr: ...