Use typing_extensions.Self in the stdlib (#9694)

This commit is contained in:
Alex Waygood
2023-02-09 09:12:13 +00:00
committed by GitHub
parent 10086c06a1
commit 9ed39d8796
98 changed files with 627 additions and 654 deletions

View File

@@ -1,9 +1,8 @@
import sys
from _typeshed import Self
from collections.abc import Callable, Iterable, Iterator, Mapping
from types import TracebackType
from typing import Any, Generic, TypeVar
from typing_extensions import Literal
from typing_extensions import Literal, Self
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -62,7 +61,7 @@ class IMapIterator(Iterator[_T]):
else:
def __init__(self, cache: dict[int, IMapIterator[Any]]) -> None: ...
def __iter__(self: Self) -> Self: ...
def __iter__(self) -> Self: ...
def next(self, timeout: float | None = None) -> _T: ...
def __next__(self, timeout: float | None = None) -> _T: ...
@@ -109,7 +108,7 @@ class Pool:
def close(self) -> None: ...
def terminate(self) -> None: ...
def join(self) -> None: ...
def __enter__(self: Self) -> Self: ...
def __enter__(self) -> Self: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...