Skip to content

Commit 504aa92

Browse files
miss-islingtonplammenskumaraditya303
authored
GH-85979: Clarify specification of object.__await__ (GH-22320)
(cherry picked from commit f59c7f8) Co-authored-by: Paolo Lammens <[email protected]> Co-authored-by: Kumar Aditya <[email protected]>
1 parent 3ab7b61 commit 504aa92

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Doc/reference/datamodel.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2879,6 +2879,14 @@ are awaitable.
28792879
:term:`awaitable` objects. For instance, :class:`asyncio.Future` implements
28802880
this method to be compatible with the :keyword:`await` expression.
28812881

2882+
.. note::
2883+
2884+
The language doesn't place any restriction on the type or value of the
2885+
objects yielded by the iterator returned by ``__await__``, as this is
2886+
specific to the implementation of the asynchronous execution framework
2887+
(e.g. :mod:`asyncio`) that will be managing the :term:`awaitable` object.
2888+
2889+
28822890
.. versionadded:: 3.5
28832891

28842892
.. seealso:: :pep:`492` for additional information about awaitable objects.

0 commit comments

Comments
 (0)