mirror of
https://github.com/python/cpython.git
synced 2025-10-03 13:45:29 +00:00
GH-85979: Clarify specification of object.__await__
(GH-22320)
(cherry picked from commit f59c7f8edd
)
Co-authored-by: Paolo Lammens <lammenspaolo@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
This commit is contained in:
parent
18006309ea
commit
f9ddbc0de5
1 changed files with 8 additions and 0 deletions
|
@ -2950,6 +2950,14 @@ are awaitable.
|
||||||
:term:`awaitable` objects. For instance, :class:`asyncio.Future` implements
|
:term:`awaitable` objects. For instance, :class:`asyncio.Future` implements
|
||||||
this method to be compatible with the :keyword:`await` expression.
|
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
|
.. versionadded:: 3.5
|
||||||
|
|
||||||
.. seealso:: :pep:`492` for additional information about awaitable objects.
|
.. seealso:: :pep:`492` for additional information about awaitable objects.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue