Drop Python 3.8 support in typing[_extensions] and types (#13763)

This commit is contained in:
Joren Hammudoglu
2025-04-02 08:56:56 +02:00
committed by GitHub
parent 0a3d8d2696
commit f6503fd9ab
4 changed files with 77 additions and 112 deletions
+26 -31
View File
@@ -47,11 +47,9 @@ __all__ = [
"WrapperDescriptorType",
"resolve_bases",
"CellType",
"GenericAlias",
]
if sys.version_info >= (3, 9):
__all__ += ["GenericAlias"]
if sys.version_info >= (3, 10):
__all__ += ["EllipsisType", "NoneType", "NotImplementedType", "UnionType"]
@@ -320,11 +318,10 @@ class MappingProxyType(Mapping[_KT, _VT_co]):
def get(self, key: _KT, /) -> _VT_co | None: ...
@overload
def get(self, key: _KT, default: _VT_co | _T2, /) -> _VT_co | _T2: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
def __reversed__(self) -> Iterator[_KT]: ...
def __or__(self, value: Mapping[_T1, _T2], /) -> dict[_KT | _T1, _VT_co | _T2]: ...
def __ror__(self, value: Mapping[_T1, _T2], /) -> dict[_KT | _T1, _VT_co | _T2]: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
def __reversed__(self) -> Iterator[_KT]: ...
def __or__(self, value: Mapping[_T1, _T2], /) -> dict[_KT | _T1, _VT_co | _T2]: ...
def __ror__(self, value: Mapping[_T1, _T2], /) -> dict[_KT | _T1, _VT_co | _T2]: ...
class SimpleNamespace:
__hash__: ClassVar[None] # type: ignore[assignment]
@@ -425,8 +422,7 @@ class AsyncGeneratorType(AsyncGenerator[_YieldT_co, _SendT_contra]):
@overload
async def athrow(self, typ: BaseException, val: None = None, tb: TracebackType | None = ..., /) -> _YieldT_co: ...
def aclose(self) -> Coroutine[Any, Any, None]: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
@final
class CoroutineType(Coroutine[_YieldT_co, _SendT_contra, _ReturnT_co]):
@@ -647,30 +643,29 @@ def coroutine(func: Callable[_P, Generator[Any, Any, _R]]) -> Callable[_P, Await
@overload
def coroutine(func: _Fn) -> _Fn: ...
if sys.version_info >= (3, 9):
class GenericAlias:
class GenericAlias:
@property
def __origin__(self) -> type | TypeAliasType: ...
@property
def __args__(self) -> tuple[Any, ...]: ...
@property
def __parameters__(self) -> tuple[Any, ...]: ...
def __new__(cls, origin: type, args: Any, /) -> Self: ...
def __getitem__(self, typeargs: Any, /) -> GenericAlias: ...
def __eq__(self, value: object, /) -> bool: ...
def __hash__(self) -> int: ...
def __mro_entries__(self, bases: Iterable[object], /) -> tuple[type, ...]: ...
if sys.version_info >= (3, 11):
@property
def __origin__(self) -> type | TypeAliasType: ...
def __unpacked__(self) -> bool: ...
@property
def __args__(self) -> tuple[Any, ...]: ...
@property
def __parameters__(self) -> tuple[Any, ...]: ...
def __new__(cls, origin: type, args: Any, /) -> Self: ...
def __getitem__(self, typeargs: Any, /) -> GenericAlias: ...
def __eq__(self, value: object, /) -> bool: ...
def __hash__(self) -> int: ...
def __mro_entries__(self, bases: Iterable[object], /) -> tuple[type, ...]: ...
if sys.version_info >= (3, 11):
@property
def __unpacked__(self) -> bool: ...
@property
def __typing_unpacked_tuple_args__(self) -> tuple[Any, ...] | None: ...
if sys.version_info >= (3, 10):
def __or__(self, value: Any, /) -> UnionType: ...
def __ror__(self, value: Any, /) -> UnionType: ...
def __typing_unpacked_tuple_args__(self) -> tuple[Any, ...] | None: ...
if sys.version_info >= (3, 10):
def __or__(self, value: Any, /) -> UnionType: ...
def __ror__(self, value: Any, /) -> UnionType: ...
# GenericAlias delegates attr access to `__origin__`
def __getattr__(self, name: str) -> Any: ...
# GenericAlias delegates attr access to `__origin__`
def __getattr__(self, name: str) -> Any: ...
if sys.version_info >= (3, 10):
@final