stdlib: Add many missing dunder overrides (#7231)

This commit is contained in:
Alex Waygood
2022-02-16 14:25:47 +00:00
committed by GitHub
parent 409beea616
commit fbc279e3f5
28 changed files with 62 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
import sys
from _typeshed import Self
from contextlib import AbstractContextManager
from types import TracebackType
from typing import Any, Callable, Generic, Iterable, Iterator, Mapping, TypeVar
from typing_extensions import Literal
@@ -67,7 +67,7 @@ class IMapIterator(Iterator[_T]):
class IMapUnorderedIterator(IMapIterator[_T]): ...
class Pool(AbstractContextManager[Pool]):
class Pool:
def __init__(
self,
processes: int | None = ...,
@@ -111,8 +111,9 @@ class Pool(AbstractContextManager[Pool]):
def terminate(self) -> None: ...
def join(self) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, exc_type: type[BaseException], exc_val: BaseException, exc_tb: TracebackType) -> None: ...
class ThreadPool(Pool, AbstractContextManager[ThreadPool]):
class ThreadPool(Pool):
def __init__(
self, processes: int | None = ..., initializer: Callable[..., Any] | None = ..., initargs: Iterable[Any] = ...
) -> None: ...