Skip to content

Commit 161a88a

Browse files
author
Guido van Rossum
committed
Issue #28049: Add documentation for typing.Awaitable and friends.
By Michael Lee.
1 parent f846cb0 commit 161a88a

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

Doc/library/typing.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,18 @@ The module defines the following classes, functions and decorators:
646646

647647
A generic version of :class:`collections.abc.ValuesView`.
648648

649+
.. class:: Awaitable(Generic[T_co])
650+
651+
A generic version of :class:`collections.abc.Awaitable`.
652+
653+
.. class:: AsyncIterable(Generic[T_co])
654+
655+
A generic version of :class:`collections.abc.AsyncIterable`.
656+
657+
.. class:: AsyncIterator(AsyncIterable[T_co])
658+
659+
A generic version of :class:`collections.abc.AsyncIterator`.
660+
649661
.. class:: ContextManager(Generic[T_co])
650662

651663
A generic version of :class:`contextlib.AbstractContextManager`.
@@ -684,7 +696,7 @@ The module defines the following classes, functions and decorators:
684696
start += 1
685697

686698
Alternatively, annotate your generator as having a return type of
687-
``Iterator[YieldType]``::
699+
either ``Iterable[YieldType]`` or ``Iterator[YieldType]``::
688700

689701
def infinite_stream(start: int) -> Iterator[int]:
690702
while True:

0 commit comments

Comments
 (0)