]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-85979: Clarify specification of `object.__await__` (GH-22320)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 31 Dec 2022 06:34:12 +0000 (22:34 -0800)
committerGitHub <noreply@github.com>
Sat, 31 Dec 2022 06:34:12 +0000 (22:34 -0800)
(cherry picked from commit f59c7f8edd5ba5f6c1954383542a2292bcf51d91)

Co-authored-by: Paolo Lammens <lammenspaolo@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Doc/reference/datamodel.rst

index 92cd2f8f8074b1c5e5331a11fd41966a8f3b6beb..afd4a5477ffb5e364bdf17dd5dd54004453ea095 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.