From c687e297eced412afc547612702f744816fc69fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilfredo=20S=C3=A1nchez=20Vega?= Date: Thu, 8 Apr 2021 16:43:46 -0700 Subject: [PATCH] Awaitable.__await__ should accept an Iterator rather than a Generator (#5194) Fixes #5125 --- stdlib/typing.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 03aee05e3..2faaee016 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -207,7 +207,7 @@ class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]): @runtime_checkable class Awaitable(Protocol[_T_co]): @abstractmethod - def __await__(self) -> Generator[Any, None, _T_co]: ... + def __await__(self) -> Iterator[_T_co]: ... class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]): __name__: str