[Python-checkins] cpython: Issue #28049: Add documentation for typing.Awaitable and friends.

guido.van.rossum python-checkins at python.org
Fri Sep 9 14:54:45 EDT 2016


https://hg.python.org/cpython/rev/eba19d4b2944
changeset:   103434:eba19d4b2944
user:        Guido van Rossum <guido at dropbox.com>
date:        Fri Sep 09 11:46:34 2016 -0700
summary:
  Issue #28049: Add documentation for typing.Awaitable and friends.

By Michael Lee.

files:
  Doc/library/typing.rst |  14 +++++++++++++-
  1 files changed, 13 insertions(+), 1 deletions(-)


diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -646,6 +646,18 @@
 
    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 @@
               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:

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list