]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-85979: Clarify specification of `object.__await__` (#22320)
authorPaolo Lammens <lammenspaolo@gmail.com>
Sat, 31 Dec 2022 06:24:04 +0000 (07:24 +0100)
committerGitHub <noreply@github.com>
Sat, 31 Dec 2022 06:24:04 +0000 (11:54 +0530)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Doc/reference/datamodel.rst

index fd682fcff020035910fc610adc9303f9a9e8c16e..1d2ddf3507aee123cf1a794ec7e02453f94c95f8 100644 (file)
@@ -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.