From 98cf9a23eb2adf31f887a6dc8ee3a8973fd91e97 Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Thu, 4 Jul 2024 08:48:28 +0530 Subject: [PATCH] Fix stubs for async generator methods (#12232) --- stdlib/typing.pyi | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 92427f91f..c64baf6ba 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -542,16 +542,18 @@ class AsyncIterator(AsyncIterable[_T_co], Protocol[_T_co]): class AsyncGenerator(AsyncIterator[_YieldT_co], Generic[_YieldT_co, _SendT_contra]): def __anext__(self) -> Awaitable[_YieldT_co]: ... @abstractmethod - def asend(self, value: _SendT_contra, /) -> Awaitable[_YieldT_co]: ... + def asend(self, value: _SendT_contra, /) -> Coroutine[Any, Any, _YieldT_co]: ... @overload @abstractmethod def athrow( self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, / - ) -> Awaitable[_YieldT_co]: ... + ) -> Coroutine[Any, Any, _YieldT_co]: ... @overload @abstractmethod - def athrow(self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /) -> Awaitable[_YieldT_co]: ... - def aclose(self) -> Awaitable[None]: ... + def athrow( + self, typ: BaseException, val: None = None, tb: TracebackType | None = None, / + ) -> Coroutine[Any, Any, _YieldT_co]: ... + def aclose(self) -> Coroutine[Any, Any, None]: ... @property def ag_await(self) -> Any: ... @property