This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author plammens
Recipients docs@python, plammens
Date 2020-09-19.13:57:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600523854.86.0.266063347768.issue41813@roundup.psfhosted.org>
In-reply-to
Content
The current specification of object.__await__ is just:

> `object.__await__(self)`
>
> Must return an iterator. Should be used to implement awaitable objects. For instance, `asyncio.Future` implements this method to be compatible with the await expression.

This is pretty vague leaves the doubt of *what* objects is the iterator expected to yield (and how the value of the yielded object affects the management of the awaitable object).

Although the vagueness is probably on purpose (since this isn't tied to any particular event loop implementation, so it can be an arbitrary iterable), I think it's worthwhile adding a note clarifying this aspect.

I originally posed this question on StackOverflow: https://stackoverflow.com/q/63964011/6117426
History
Date User Action Args
2020-09-19 13:57:34plammenssetrecipients: + plammens, docs@python
2020-09-19 13:57:34plammenssetmessageid: <1600523854.86.0.266063347768.issue41813@roundup.psfhosted.org>
2020-09-19 13:57:34plammenslinkissue41813 messages
2020-09-19 13:57:34plammenscreate