summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGuido van Rossum <guido@dropbox.com>2016-09-09 18:46:34 (GMT)
committerGuido van Rossum <guido@dropbox.com>2016-09-09 18:46:34 (GMT)
commit922175922cb92371b0086b0424ca37b515acf713 (patch)
treeb297d577bebf58862ed6f8a9057d5214f6c05cc0 /Doc
parentbf04b0698b91df3c7ceb4f712956b84614bb5c53 (diff)
downloadcpython-922175922cb92371b0086b0424ca37b515acf713.zip
cpython-922175922cb92371b0086b0424ca37b515acf713.tar.gz
cpython-922175922cb92371b0086b0424ca37b515acf713.tar.bz2
Issue #28049: Add documentation for typing.Awaitable and friends.
By Michael Lee.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/typing.rst14
1 files changed, 13 insertions, 1 deletions
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 0139c75..23bcc8c 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -646,6 +646,18 @@ The module defines the following classes, functions and decorators:
A generic version of :class:`collections.abc.ValuesView`.
+.. class:: Awaitable(Generic[T_co])
+
+ A generic version of :class:`collections.abc.Awaitable`.
+
+.. class:: AsyncIterable(Generic[T_co])
+
+ A generic version of :class:`collections.abc.AsyncIterable`.
+
+.. class:: AsyncIterator(AsyncIterable[T_co])
+
+ A generic version of :class:`collections.abc.AsyncIterator`.
+
.. class:: ContextManager(Generic[T_co])
A generic version of :class:`contextlib.AbstractContextManager`.
@@ -684,7 +696,7 @@ The module defines the following classes, functions and decorators:
start += 1
Alternatively, annotate your generator as having a return type of
- ``Iterator[YieldType]``::
+ either ``Iterable[YieldType]`` or ``Iterator[YieldType]``::
def infinite_stream(start: int) -> Iterator[int]:
while True: