Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove typing.AwaitableGenerator
Part of #7580
  • Loading branch information
srittau committed Nov 1, 2025
commit 1ed616e124e01ff6be11ac0d9a2d44e4832bc73d
13 changes: 1 addition & 12 deletions stdlib/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand Down
Loading