Fix stubs for async generator methods (#12232)

This commit is contained in:
Kumar Aditya
2024-07-04 08:48:28 +05:30
committed by GitHub
parent bc6335c238
commit 98cf9a23eb

View File

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