mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-23 04:11:28 +08:00
add AsyncGenerator to typing.pyi, collections/abc.pyi and collections/__init__.pyi (#815)
This parallels https://github.com/python/typing/pull/346
This commit is contained in:
committed by
Guido van Rossum
parent
2195b9d297
commit
df9d11bf71
@@ -151,6 +151,24 @@ class AsyncIterator(AsyncIterable[_T_co],
|
||||
def __anext__(self) -> Awaitable[_T_co]: ...
|
||||
def __aiter__(self) -> 'AsyncIterator[_T_co]': ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
class AsyncGenerator(AsyncIterator[_T_co], Generic[_T_co, _T_contra]):
|
||||
@abstractmethod
|
||||
def __anext__(self) -> Awaitable[_T_co]: ...
|
||||
|
||||
@abstractmethod
|
||||
def asend(self, value: _T_contra) -> Awaitable[_T_co]: ...
|
||||
|
||||
@abstractmethod
|
||||
def athrow(self, typ: Type[BaseException], val: Optional[BaseException] = None,
|
||||
tb: Any = None) -> Awaitable[None]: ...
|
||||
|
||||
@abstractmethod
|
||||
def aclose(self) -> Awaitable[None]: ...
|
||||
|
||||
@abstractmethod
|
||||
def __aiter__(self) -> 'AsyncGenerator[_T_co, _T_contra]': ...
|
||||
|
||||
class Container(Generic[_T_co]):
|
||||
@abstractmethod
|
||||
def __contains__(self, x: object) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user