Awaitable.__await__ should accept an Iterator rather than a Generator (#5194)

Fixes #5125
This commit is contained in:
Wilfredo Sánchez Vega
2021-04-08 16:43:46 -07:00
committed by GitHub
parent e2c4ffd9eb
commit c687e297ec

View File

@@ -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