summaryrefslogtreecommitdiffstats
path: root/Doc/reference
diff options
context:
space:
mode:
authorPaolo Lammens <lammenspaolo@gmail.com>2022-12-31 06:24:04 (GMT)
committerGitHub <noreply@github.com>2022-12-31 06:24:04 (GMT)
commitf59c7f8edd5ba5f6c1954383542a2292bcf51d91 (patch)
tree1921387c9cf561680f1328294fdad597e1997ad2 /Doc/reference
parent4ebaae8aedd91d2cffa5e89123f3539ddcbdfd5b (diff)
downloadcpython-f59c7f8edd5ba5f6c1954383542a2292bcf51d91.zip
cpython-f59c7f8edd5ba5f6c1954383542a2292bcf51d91.tar.gz
cpython-f59c7f8edd5ba5f6c1954383542a2292bcf51d91.tar.bz2
GH-85979: Clarify specification of `object.__await__` (#22320)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Diffstat (limited to 'Doc/reference')
-rw-r--r--Doc/reference/datamodel.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index fd682fc..1d2ddf3 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -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.