Message245415
| Author |
martin.panter |
| Recipients |
docs@python, martin.panter, yselivanov |
| Date |
2015年06月16日.03:41:47 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1434426112.48.0.163613846281.issue24439@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|