fix self type for stdlib/2 (#645)

This commit is contained in:
Elazar Gershuni
2016-10-30 23:51:52 +02:00
committed by Guido van Rossum
parent 252a772b67
commit 59f86e1b6a
8 changed files with 12 additions and 12 deletions

View File

@@ -913,7 +913,7 @@ class file(BinaryIO):
@overload
def __init__(self, file: unicode, mode: str = 'r', buffering: int = ...) -> None: ...
@overload
def __init__(file: int, mode: str = 'r', buffering: int = ...) -> None: ...
def __init__(self, file: int, mode: str = 'r', buffering: int = ...) -> None: ...
def __iter__(self) -> Iterator[str]: ...
def read(self, n: int = ...) -> str: ...
def __enter__(self) -> BinaryIO: ...

View File

@@ -9,7 +9,7 @@ class Struct(object):
format = ... # type: str
def __init__(self, fmt: str) -> None: ...
def pack_into(buffer: bytearray, offset: int, obj: Any) -> None: ...
def pack_into(self, buffer: bytearray, offset: int, obj: Any) -> None: ...
def pack(self, *args) -> str: ...
def unpack(self, s:str) -> Tuple[Any]: ...
def unpack_from(self, buffer: bytearray, offset:int = ...) -> Tuple[Any]: ...

View File

@@ -36,6 +36,6 @@ class symtable(object):
type = ... # type: int
varnames = ... # type: List[str]
def __init__(src: str, filename: str, startstr: str) -> None: ...
def __init__(self, src: str, filename: str, startstr: str) -> None: ...

View File

@@ -32,4 +32,4 @@ def release_lock() -> None: ...
class NullImporter:
def __init__(self, path_string: str) -> None: ...
def find_module(fullname: str, path: str = ...) -> None: ...
def find_module(self, fullname: str, path: str = ...) -> None: ...

View File

@@ -94,7 +94,7 @@ class epoll(object):
def fileno(self) -> int: ...
def register(self, fd: int, eventmask: int = ...) -> None: ...
def modify(self, fd: int, eventmask: int) -> None: ...
def unregister(fd: int) -> None: ...
def poll(timeout: float = ..., maxevents: int = ...) -> Any: ...
def unregister(self, fd: int) -> None: ...
def poll(self, timeout: float = ..., maxevents: int = ...) -> Any: ...
@classmethod
def fromfd(self, fd: int) -> epoll: ...
def fromfd(cls, fd: int) -> epoll: ...

View File

@@ -10,7 +10,7 @@ class shlex:
def sourcehook(self, filename: str) -> None: ...
def push_source(self, stream: IO[Any], filename: str = ...) -> None: ...
def pop_source(self) -> IO[Any]: ...
def error_leader(file: str = ..., line: int = ...) -> str: ...
def error_leader(self, file: str = ..., line: int = ...) -> str: ...
commenters = ... # type: str
wordchars = ... # type: str

View File

@@ -169,8 +169,8 @@ class SSLContext:
binary_form: bool = ...) -> Union[List[_PeerCertRetDictType], List[bytes]]: ...
def set_default_verify_paths(self) -> None: ...
def set_ciphers(self, ciphers: str) -> None: ...
def set_alpn_protocols(protocols: List[str]) -> None: ...
def set_npn_protocols(protocols: List[str]) -> None: ...
def set_alpn_protocols(self, protocols: List[str]) -> None: ...
def set_npn_protocols(self, protocols: List[str]) -> None: ...
def set_servername_callback(self,
server_name_callback: Optional[_SrvnmeCbType]) -> None: ...
def load_dh_params(self, dhfile: str) -> None: ...

View File

@@ -27,7 +27,7 @@ class _RandomNameSequence:
def __iter__(self) -> "_RandomNameSequence": ...
def next(self) -> str: ...
# from os.path:
def normcase(path: AnyStr) -> AnyStr: ...
def normcase(self, path: AnyStr) -> AnyStr: ...
class _TemporaryFileWrapper(IO[str]):
close_called = ... # type: bool
@@ -40,7 +40,7 @@ class _TemporaryFileWrapper(IO[str]):
def __exit__(self, exc, value, tb) -> bool: ...
def __getattr__(self, name: unicode) -> Any: ...
def close(self) -> None: ...
def unlink(path: unicode) -> None: ...
def unlink(self, path: unicode) -> None: ...
# TODO text files