[Python-checkins] GH-85979: Clarify specification of `object.__await__` (GH-22320)

miss-islington webhook-mailer at python.org
Sat Dec 31 01:31:48 EST 2022


https://github.com/python/cpython/commit/504aa92b70d3902f373dc5a6ca0b3ddc1ad233d5
commit: 504aa92b70d3902f373dc5a6ca0b3ddc1ad233d5
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-12-30T22:31:41-08:00
summary:

GH-85979: Clarify specification of `object.__await__` (GH-22320)

(cherry picked from commit f59c7f8edd5ba5f6c1954383542a2292bcf51d91)

Co-authored-by: Paolo Lammens <lammenspaolo at gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303 at users.noreply.github.com>

files:
M Doc/reference/datamodel.rst

diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index eafb6ff15998..6aed328a9fdb 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -2879,6 +2879,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.



More information about the Python-checkins mailing list