]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #28049: Add documentation for typing.Awaitable and friends.
authorGuido van Rossum <guido@dropbox.com>
Fri, 9 Sep 2016 18:46:34 +0000 (11:46 -0700)
committerGuido van Rossum <guido@dropbox.com>
Fri, 9 Sep 2016 18:46:34 +0000 (11:46 -0700)
By Michael Lee.

Doc/library/typing.rst

index 0139c75326b52015e7dbc223fa93cbecf1b04831..23bcc8c4155ba052f245b5f40b1b40c8fb33d5da 100644 (file)
@@ -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: