From 1ed616e124e01ff6be11ac0d9a2d44e4832bc73d Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sat, 1 Nov 2025 14:52:45 +0100 Subject: [PATCH 1/2] Remove typing.AwaitableGenerator Part of #7580 --- stdlib/typing.pyi | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 2ca65dad4562..50ee7b75ba29 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -577,7 +577,7 @@ class Awaitable(Protocol[_T_co]): @abstractmethod def __await__(self) -> Generator[Any, Any, _T_co]: ... -# Non-default variations to accommodate coroutines, and `AwaitableGenerator` having a 4th type parameter. +# Non-default variations to accommodate coroutines having a 4th type parameter. _SendT_nd_contra = TypeVar("_SendT_nd_contra", contravariant=True) _ReturnT_nd_co = TypeVar("_ReturnT_nd_co", covariant=True) @@ -598,17 +598,6 @@ class Coroutine(Awaitable[_ReturnT_nd_co], Generic[_YieldT_co, _SendT_nd_contra, @abstractmethod def close(self) -> None: ... -# NOTE: This type does not exist in typing.py or PEP 484 but mypy needs it to exist. -# The parameters correspond to Generator, but the 4th is the original type. -# Obsolete, use _typeshed._type_checker_internals.AwaitableGenerator instead. -@type_check_only -class AwaitableGenerator( - Awaitable[_ReturnT_nd_co], - Generator[_YieldT_co, _SendT_nd_contra, _ReturnT_nd_co], - Generic[_YieldT_co, _SendT_nd_contra, _ReturnT_nd_co, _S], - metaclass=ABCMeta, -): ... - @runtime_checkable class AsyncIterable(Protocol[_T_co]): @abstractmethod From c4f000f2db9fafcbfdb521e19d7cda9495e18012 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sat, 1 Nov 2025 14:57:17 +0100 Subject: [PATCH 2/2] Remove unused type var --- stdlib/typing.pyi | 1 - 1 file changed, 1 deletion(-) diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 50ee7b75ba29..69a39fdca88e 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -402,7 +402,6 @@ _T = TypeVar("_T") _FT = TypeVar("_FT", bound=Callable[..., Any] | type) # These type variables are used by the container types. -_S = TypeVar("_S") _KT = TypeVar("_KT") # Key type. _VT = TypeVar("_VT") # Value type. _T_co = TypeVar("_T_co", covariant=True) # Any type covariant containers.