diff options
author | Guido van Rossum <guido@python.org> | 2015-12-04 01:31:24 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2015-12-04 01:31:24 (GMT) |
commit | f17c20076cb9e6b96cf1f1fe19062b397ff58b3a (patch) | |
tree | 54400220a291558ecacba7fc978fdb771037b64c /Lib/typing.py | |
parent | b1f64e7d292fb0b1830185e7243c0341e28e6899 (diff) | |
download | cpython-f17c20076cb9e6b96cf1f1fe19062b397ff58b3a.zip cpython-f17c20076cb9e6b96cf1f1fe19062b397ff58b3a.tar.gz cpython-f17c20076cb9e6b96cf1f1fe19062b397ff58b3a.tar.bz2 |
Add Awaitable, AsyncIterable, AsyncIterator to typing.py.
Diffstat (limited to 'Lib/typing.py')
-rw-r--r-- | Lib/typing.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/typing.py b/Lib/typing.py index 1757f13..823f9be 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -28,6 +28,9 @@ __all__ = [ # ABCs (from collections.abc). 'AbstractSet', # collections.abc.Set. + 'Awaitable', + 'AsyncIterator', + 'AsyncIterable', 'ByteString', 'Container', 'Hashable', @@ -1261,6 +1264,18 @@ class _Protocol(metaclass=_ProtocolMeta): Hashable = collections_abc.Hashable # Not generic. +class Awaitable(Generic[T_co], extra=collections_abc.Awaitable): + __slots__ = () + + +class AsyncIterable(Generic[T_co], extra=collections_abc.AsyncIterable): + __slots__ = () + + +class AsyncIterator(AsyncIterable[T_co], extra=collections_abc.AsyncIterator): + __slots__ = () + + class Iterable(Generic[T_co], extra=collections_abc.Iterable): __slots__ = () |