Message258050
Nick,
> After all, waiting for the result with "await" is only one way to terminate a coroutine - you can also get there with direct calls to next(), send(), throw() and close().
Yes, but I expect that almost nobody will use 'send', 'throw' etc on coroutines, it's too low level. In asyncio there is only one place where this magic happens. Regular user will only understand the 'await' part -- that's why I wanted to mention it in the error message.
async def something():
await coro
^ RuntimeError('Cannot resume terminated coroutine')
The above use case might be a bit hard for users to actually understand, as opposed to
async def something():
await coro
^ RuntimeError('coroutine was already awaited on')
What do you think?
Martin, thanks for the review! |
|
Date |
User |
Action |
Args |
2016-01-12 01:43:43 | yselivanov | set | recipients:
+ yselivanov, gvanrossum, brett.cannon, ncoghlan, vstinner, asvetlov, martin.panter |
2016-01-12 01:43:43 | yselivanov | set | messageid: <1452563023.39.0.668331723407.issue25887@psf.upfronthosting.co.za> |
2016-01-12 01:43:43 | yselivanov | link | issue25887 messages |
2016-01-12 01:43:43 | yselivanov | create | |
|