Use _typeshed.Self in Python 2, too (#6932)

This commit is contained in:
Alex Waygood
2022-01-16 22:44:51 +00:00
committed by GitHub
parent 0949e9e90d
commit 6a88d5e7ae
29 changed files with 156 additions and 160 deletions

View File

@@ -1,4 +1,5 @@
from typing import IO, Any, AnyStr, List, Mapping, Sequence, Text, Tuple, TypeVar
from _typeshed import Self
from typing import IO, Any, AnyStr, List, Mapping, Sequence, Text, Tuple
def url2pathname(pathname: AnyStr) -> AnyStr: ...
def pathname2url(pathname: AnyStr) -> AnyStr: ...
@@ -77,15 +78,13 @@ class ftpwrapper:
def file_close(self): ...
def real_close(self): ...
_AIUT = TypeVar("_AIUT", bound=addbase)
class addbase:
fp: Any
def read(self, n: int = ...) -> bytes: ...
def readline(self, limit: int = ...) -> bytes: ...
def readlines(self, hint: int = ...) -> List[bytes]: ...
def fileno(self) -> int: ... # Optional[int], but that is rare
def __iter__(self: _AIUT) -> _AIUT: ...
def __iter__(self: Self) -> Self: ...
def next(self) -> bytes: ...
def __init__(self, fp) -> None: ...
def close(self) -> None: ...