Skip to content

Commit f59c7f8

Browse files
GH-85979: Clarify specification of object.__await__ (#22320)
Co-authored-by: Kumar Aditya <[email protected]>
1 parent 4ebaae8 commit f59c7f8

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
@@ -2950,6 +2950,14 @@ are awaitable.
29502950
:term:`awaitable` objects. For instance, :class:`asyncio.Future` implements
29512951
this method to be compatible with the :keyword:`await` expression.
29522952

2953+
.. note::
2954+
2955+
The language doesn't place any restriction on the type or value of the
2956+
objects yielded by the iterator returned by ``__await__``, as this is
2957+
specific to the implementation of the asynchronous execution framework
2958+
(e.g. :mod:`asyncio`) that will be managing the :term:`awaitable` object.
2959+
2960+
29532961
.. versionadded:: 3.5
29542962

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

0 commit comments

Comments
 (0)