Message245415
It seems that Issue 24400 may implement __await__() for native coroutine instances, making points 1, 2 and 4 mainly redundant. This would also bypass a fifth problem: the need for the mandatory yet largely useless send(None) argument.
I am posting async-doc.patch, with these changes:
* Distinguish between PEP 492’s “native coroutines” and other coroutines such as those already supported by asyncio and PEP 342 (“yield” expression and generator cleanup)
* Move “coroutine” before “coroutine function” in the glossary.
* Add links to “coroutine” glossary
* Point 3: Explain about “async” and “await” becoming reserved keywords after a “def” header line
* Part of point 2: List native coroutine instance methods and hint at relationship with generator iterator instances
Still to do: how to drive an awaitable coroutine. Currently it seems you have to call coro.send(None), but if the current patch for Issue 24400 were applied, I think it would become next(coro), so I will leave this for later. |
|
Date |
User |
Action |
Args |
2015-06-16 03:41:52 | martin.panter | set | recipients:
+ martin.panter, docs@python, yselivanov |
2015-06-16 03:41:52 | martin.panter | set | messageid: <1434426112.48.0.163613846281.issue24439@psf.upfronthosting.co.za> |
2015-06-16 03:41:52 | martin.panter | link | issue24439 messages |
2015-06-16 03:41:51 | martin.panter | create | |
|