diff --git a/stdlib/2/_winreg.pyi b/stdlib/2/_winreg.pyi index 4bdfcbf98..ff3b41d2c 100644 --- a/stdlib/2/_winreg.pyi +++ b/stdlib/2/_winreg.pyi @@ -4,7 +4,7 @@ from typing import Any, Optional, Tuple, Type, Union _KeyType = Union[HKEYType, int] -def CloseKey(__hkey: _KeyType): ... +def CloseKey(__hkey: _KeyType) -> None: ... def ConnectRegistry(__computer_name: Optional[str], __key: _KeyType) -> HKEYType: ... def CreateKey(__key: _KeyType, __sub_key: Optional[str]) -> HKEYType: ... def CreateKeyEx(key: _KeyType, sub_key: Optional[str], reserved: int = ..., access: int = ...) -> HKEYType: ... diff --git a/stdlib/3/_tracemalloc.pyi b/stdlib/3/_tracemalloc.pyi index c2ec2adea..10e679783 100644 --- a/stdlib/3/_tracemalloc.pyi +++ b/stdlib/3/_tracemalloc.pyi @@ -1,7 +1,7 @@ from tracemalloc import _FrameTupleT, _TraceTupleT from typing import Optional, Sequence, Tuple -def _get_object_traceback(__obj) -> Optional[Sequence[_FrameTupleT]]: ... +def _get_object_traceback(__obj: object) -> Optional[Sequence[_FrameTupleT]]: ... def _get_traces() -> Sequence[_TraceTupleT]: ... def clear_traces() -> None: ... def get_traceback_limit() -> int: ... diff --git a/stdlib/3/asyncio/base_futures.pyi b/stdlib/3/asyncio/base_futures.pyi index ae6ded094..f4119c937 100644 --- a/stdlib/3/asyncio/base_futures.pyi +++ b/stdlib/3/asyncio/base_futures.pyi @@ -1,5 +1,5 @@ import contextvars -from typing import Callable, List, Sequence, Tuple +from typing import Any, Callable, List, Sequence, Tuple from typing_extensions import Literal from . import futures @@ -9,5 +9,5 @@ _CANCELLED: Literal["CANCELLED"] # undocumented _FINISHED: Literal["FINISHED"] # undocumented def isfuture(obj: object) -> bool: ... -def _format_callbacks(cb: Sequence[Tuple[Callable[[futures.Future], None], contextvars.Context]]) -> str: ... # undocumented -def _future_repr_info(future: futures.Future) -> List[str]: ... # undocumented +def _format_callbacks(cb: Sequence[Tuple[Callable[[futures.Future[Any]], None], contextvars.Context]]) -> str: ... # undocumented +def _future_repr_info(future: futures.Future[Any]) -> List[str]: ... # undocumented diff --git a/stdlib/3/asyncio/base_subprocess.pyi b/stdlib/3/asyncio/base_subprocess.pyi index a7cf7e5cf..acdf98520 100644 --- a/stdlib/3/asyncio/base_subprocess.pyi +++ b/stdlib/3/asyncio/base_subprocess.pyi @@ -10,10 +10,10 @@ class BaseSubprocessTransport(transports.SubprocessTransport): _closed: bool # undocumented _protocol: protocols.SubprocessProtocol # undocumented _loop: events.AbstractEventLoop # undocumented - _proc: Optional[subprocess.Popen] # undocumented + _proc: Optional[subprocess.Popen[Any]] # undocumented _pid: Optional[int] # undocumented _returncode: Optional[int] # undocumented - _exit_waiters: List[futures.Future] # undocumented + _exit_waiters: List[futures.Future[Any]] # undocumented _pending_calls: Deque[Tuple[Callable[..., Any], Tuple[Any, ...]]] # undocumented _pipes: Dict[int, _File] # undocumented _finished: bool # undocumented @@ -27,7 +27,7 @@ class BaseSubprocessTransport(transports.SubprocessTransport): stdout: _File, stderr: _File, bufsize: int, - waiter: Optional[futures.Future] = ..., + waiter: Optional[futures.Future[Any]] = ..., extra: Optional[Any] = ..., **kwargs: Any, ) -> None: ... @@ -40,7 +40,7 @@ class BaseSubprocessTransport(transports.SubprocessTransport): stderr: _File, bufsize: int, **kwargs: Any, - ): ... # undocumented + ) -> None: ... # undocumented def set_protocol(self, protocol: protocols.BaseProtocol) -> None: ... def get_protocol(self) -> protocols.BaseProtocol: ... def is_closing(self) -> bool: ... @@ -52,7 +52,7 @@ class BaseSubprocessTransport(transports.SubprocessTransport): def send_signal(self, signal: int) -> None: ... # type: ignore def terminate(self) -> None: ... def kill(self) -> None: ... - async def _connect_pipes(self, waiter: Optional[futures.Future]) -> None: ... # undocumented + async def _connect_pipes(self, waiter: Optional[futures.Future[Any]]) -> None: ... # undocumented def _call(self, cb: Callable[..., Any], *data: Any) -> None: ... # undocumented def _pipe_connection_lost(self, fd: int, exc: Optional[BaseException]) -> None: ... # undocumented def _pipe_data_received(self, fd: int, data: bytes) -> None: ... # undocumented diff --git a/stdlib/3/asyncio/base_tasks.pyi b/stdlib/3/asyncio/base_tasks.pyi index 79542d18c..fbe0a03e8 100644 --- a/stdlib/3/asyncio/base_tasks.pyi +++ b/stdlib/3/asyncio/base_tasks.pyi @@ -1,9 +1,9 @@ from _typeshed import AnyPath from types import FrameType -from typing import List, Optional +from typing import Any, List, Optional from . import tasks -def _task_repr_info(task: tasks.Task) -> List[str]: ... # undocumented -def _task_get_stack(task: tasks.Task, limit: Optional[int]) -> List[FrameType]: ... # undocumented -def _task_print_stack(task: tasks.Task, limit: Optional[int], file: AnyPath): ... # undocumented +def _task_repr_info(task: tasks.Task[Any]) -> List[str]: ... # undocumented +def _task_get_stack(task: tasks.Task[Any], limit: Optional[int]) -> List[FrameType]: ... # undocumented +def _task_print_stack(task: tasks.Task[Any], limit: Optional[int], file: AnyPath) -> None: ... # undocumented diff --git a/stdlib/3/asyncio/sslproto.pyi b/stdlib/3/asyncio/sslproto.pyi index 0b921df93..c797f89ce 100644 --- a/stdlib/3/asyncio/sslproto.pyi +++ b/stdlib/3/asyncio/sslproto.pyi @@ -81,7 +81,7 @@ class SSLProtocol(protocols.Protocol): _extra: Dict[str, Any] _write_backlog: Deque[Tuple[bytes, int]] _write_buffer_size: int - _waiter: futures.Future + _waiter: futures.Future[Any] _loop: events.AbstractEventLoop _app_transport: _SSLProtocolTransport _sslpipe: Optional[_SSLPipe] @@ -100,7 +100,7 @@ class SSLProtocol(protocols.Protocol): loop: events.AbstractEventLoop, app_protocol: protocols.BaseProtocol, sslcontext: ssl.SSLContext, - waiter: futures.Future, + waiter: futures.Future[Any], server_side: bool = ..., server_hostname: Optional[str] = ..., call_connection_made: bool = ..., diff --git a/stdlib/3/asyncio/staggered.pyi b/stdlib/3/asyncio/staggered.pyi index dd7468fce..057883e0a 100644 --- a/stdlib/3/asyncio/staggered.pyi +++ b/stdlib/3/asyncio/staggered.pyi @@ -5,5 +5,8 @@ from . import events if sys.version_info >= (3, 8): async def staggered_race( - coro_fns: Iterable[Callable[[], Awaitable]], delay: Optional[float], *, loop: Optional[events.AbstractEventLoop] = ... + coro_fns: Iterable[Callable[[], Awaitable[Any]]], + delay: Optional[float], + *, + loop: Optional[events.AbstractEventLoop] = ..., ) -> Tuple[Any, Optional[int], List[Optional[Exception]]]: ... diff --git a/stdlib/3/gzip.pyi b/stdlib/3/gzip.pyi index 2d389cfc3..6d9fef73e 100644 --- a/stdlib/3/gzip.pyi +++ b/stdlib/3/gzip.pyi @@ -83,9 +83,9 @@ class _GzipReader(_compression.DecompressReader): def read(self, size: int = ...) -> bytes: ... if sys.version_info >= (3, 8): - def compress(data, compresslevel: int = ..., *, mtime: Optional[float] = ...) -> bytes: ... + def compress(data: bytes, compresslevel: int = ..., *, mtime: Optional[float] = ...) -> bytes: ... else: - def compress(data, compresslevel: int = ...) -> bytes: ... + def compress(data: bytes, compresslevel: int = ...) -> bytes: ... def decompress(data: bytes) -> bytes: ... diff --git a/stdlib/3/ipaddress.pyi b/stdlib/3/ipaddress.pyi index f066f8934..e3f3c3420 100644 --- a/stdlib/3/ipaddress.pyi +++ b/stdlib/3/ipaddress.pyi @@ -84,7 +84,7 @@ class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]): def max_prefixlen(self) -> int: ... @property def num_addresses(self) -> int: ... - def overlaps(self, other: _BaseNetwork) -> bool: ... + def overlaps(self, other: _BaseNetwork[_A]) -> bool: ... @property def prefixlen(self) -> int: ... if sys.version_info >= (3, 7): diff --git a/stdlib/3/types.pyi b/stdlib/3/types.pyi index 8d6619463..8e8ef4a10 100644 --- a/stdlib/3/types.pyi +++ b/stdlib/3/types.pyi @@ -326,5 +326,5 @@ if sys.version_info >= (3, 9): __origin__: type __args__: Tuple[Any, ...] __parameters__: Tuple[Any, ...] - def __init__(self, origin: type, args: Any): ... + def __init__(self, origin: type, args: Any) -> None: ... def __getattr__(self, name: str) -> Any: ... # incomplete diff --git a/stdlib/3/unittest/loader.pyi b/stdlib/3/unittest/loader.pyi index 1896e7897..48c9f1c5f 100644 --- a/stdlib/3/unittest/loader.pyi +++ b/stdlib/3/unittest/loader.pyi @@ -46,5 +46,5 @@ def makeSuite( suiteClass: _SuiteClass = ..., ) -> unittest.suite.TestSuite: ... def findTestCases( - module, prefix: str = ..., sortUsing: _SortComparisonMethod = ..., suiteClass: _SuiteClass = ... + module: ModuleType, prefix: str = ..., sortUsing: _SortComparisonMethod = ..., suiteClass: _SuiteClass = ... ) -> unittest.suite.TestSuite: ... diff --git a/stdlib/3/urllib/error.pyi b/stdlib/3/urllib/error.pyi index e727f4ded..83dcf8f8d 100644 --- a/stdlib/3/urllib/error.pyi +++ b/stdlib/3/urllib/error.pyi @@ -1,4 +1,4 @@ -from typing import Union +from typing import IO, Mapping, Union from urllib.response import addinfourl # Stubs for urllib.error @@ -8,6 +8,6 @@ class URLError(IOError): class HTTPError(URLError, addinfourl): code: int - def __init__(self, url, code, msg, hdrs, fp) -> None: ... + def __init__(self, url: str, code: int, msg: str, hdrs: Mapping[str, str], fp: IO[bytes]) -> None: ... class ContentTooShortError(URLError): ... diff --git a/stdlib/3/urllib/request.pyi b/stdlib/3/urllib/request.pyi index 3ae6c9ca7..c78f55624 100644 --- a/stdlib/3/urllib/request.pyi +++ b/stdlib/3/urllib/request.pyi @@ -191,8 +191,8 @@ class UnknownHandler(BaseHandler): def unknown_open(self, req: Request) -> NoReturn: ... class HTTPErrorProcessor(BaseHandler): - def http_response(self, request, response) -> _UrlopenRet: ... - def https_response(self, request, response) -> _UrlopenRet: ... + def http_response(self, request: Request, response: HTTPResponse) -> _UrlopenRet: ... + def https_response(self, request: Request, response: HTTPResponse) -> _UrlopenRet: ... if sys.version_info >= (3, 6): def urlretrieve( diff --git a/stdlib/3/winreg.pyi b/stdlib/3/winreg.pyi index 4bdfcbf98..ff3b41d2c 100644 --- a/stdlib/3/winreg.pyi +++ b/stdlib/3/winreg.pyi @@ -4,7 +4,7 @@ from typing import Any, Optional, Tuple, Type, Union _KeyType = Union[HKEYType, int] -def CloseKey(__hkey: _KeyType): ... +def CloseKey(__hkey: _KeyType) -> None: ... def ConnectRegistry(__computer_name: Optional[str], __key: _KeyType) -> HKEYType: ... def CreateKey(__key: _KeyType, __sub_key: Optional[str]) -> HKEYType: ... def CreateKeyEx(key: _KeyType, sub_key: Optional[str], reserved: int = ..., access: int = ...) -> HKEYType: ... diff --git a/stdlib/3/xmlrpc/client.pyi b/stdlib/3/xmlrpc/client.pyi index 8ad5d7d70..4f596987c 100644 --- a/stdlib/3/xmlrpc/client.pyi +++ b/stdlib/3/xmlrpc/client.pyi @@ -60,7 +60,7 @@ def _strftime(value: _XMLDate) -> str: ... # undocumented class DateTime: value: str # undocumented - def __init__(self, value: Union[int, str, datetime, time.struct_time, Tuple[int, ...]] = ...): ... + def __init__(self, value: Union[int, str, datetime, time.struct_time, Tuple[int, ...]] = ...) -> None: ... def __lt__(self, other: _DateTimeComparable) -> bool: ... def __le__(self, other: _DateTimeComparable) -> bool: ... def __gt__(self, other: _DateTimeComparable) -> bool: ... @@ -268,7 +268,7 @@ class ServerProxy: if sys.version_info >= (3, 8): def __init__( self, - uri, + uri: str, transport: Optional[Transport] = ..., encoding: Optional[str] = ..., verbose: bool = ..., @@ -282,7 +282,7 @@ class ServerProxy: else: def __init__( self, - uri, + uri: str, transport: Optional[Transport] = ..., encoding: Optional[str] = ..., verbose: bool = ..., diff --git a/third_party/2/ipaddress.pyi b/third_party/2/ipaddress.pyi index f066f8934..e3f3c3420 100644 --- a/third_party/2/ipaddress.pyi +++ b/third_party/2/ipaddress.pyi @@ -84,7 +84,7 @@ class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]): def max_prefixlen(self) -> int: ... @property def num_addresses(self) -> int: ... - def overlaps(self, other: _BaseNetwork) -> bool: ... + def overlaps(self, other: _BaseNetwork[_A]) -> bool: ... @property def prefixlen(self) -> int: ... if sys.version_info >= (3, 7):