Skip to content

Commit 98cf9a2

Browse files
Fix stubs for async generator methods (#12232)
1 parent bc6335c commit 98cf9a2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

stdlib/typing.pyi

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,16 +542,18 @@ class AsyncIterator(AsyncIterable[_T_co], Protocol[_T_co]):
542542
class AsyncGenerator(AsyncIterator[_YieldT_co], Generic[_YieldT_co, _SendT_contra]):
543543
def __anext__(self) -> Awaitable[_YieldT_co]: ...
544544
@abstractmethod
545-
def asend(self, value: _SendT_contra, /) -> Awaitable[_YieldT_co]: ...
545+
def asend(self, value: _SendT_contra, /) -> Coroutine[Any, Any, _YieldT_co]: ...
546546
@overload
547547
@abstractmethod
548548
def athrow(
549549
self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, /
550-
) -> Awaitable[_YieldT_co]: ...
550+
) -> Coroutine[Any, Any, _YieldT_co]: ...
551551
@overload
552552
@abstractmethod
553-
def athrow(self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /) -> Awaitable[_YieldT_co]: ...
554-
def aclose(self) -> Awaitable[None]: ...
553+
def athrow(
554+
self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /
555+
) -> Coroutine[Any, Any, _YieldT_co]: ...
556+
def aclose(self) -> Coroutine[Any, Any, None]: ...
555557
@property
556558
def ag_await(self) -> Any: ...
557559
@property

0 commit comments

Comments
 (0)