Message377166
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 |
|
Date |
User |
Action |
Args |
2020-09-19 13:57:34 | plammens | set | recipients:
+ plammens, docs@python |
2020-09-19 13:57:34 | plammens | set | messageid: <1600523854.86.0.266063347768.issue41813@roundup.psfhosted.org> |
2020-09-19 13:57:34 | plammens | link | issue41813 messages |
2020-09-19 13:57:34 | plammens | create | |
|