Skip to content

Commit

Permalink
GH-85979: Clarify specification of object.__await__ (#22320)
Browse files Browse the repository at this point in the history
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
  • Loading branch information
plammens and kumaraditya303 authored Dec 31, 2022
1 parent 4ebaae8 commit f59c7f8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2950,6 +2950,14 @@ are awaitable.
:term:`awaitable` objects. For instance, :class:`asyncio.Future` implements
this method to be compatible with the :keyword:`await` expression.

.. note::

The language doesn't place any restriction on the type or value of the
objects yielded by the iterator returned by ``__await__``, as this is
specific to the implementation of the asynchronous execution framework
(e.g. :mod:`asyncio`) that will be managing the :term:`awaitable` object.


.. versionadded:: 3.5

.. seealso:: :pep:`492` for additional information about awaitable objects.
Expand Down

0 comments on commit f59c7f8

Please sign in to comment.