Message256535
| Author |
yselivanov |
| Recipients |
asvetlov, gvanrossum, ncoghlan, vstinner, yselivanov |
| Date |
2015年12月16日.21:46:57 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1450302417.78.0.492418197951.issue25887@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
async def foo():
return 123
print(await foo()) # will print 123
print(await foo()) # prints None
print(await foo()) # prints None
The above code illustrates the current behaviour. I propose to change it, so that second 'await' will trigger a RuntimeError, explaining the the coroutine was awaited more than once.
This would make coroutines more predictable, and would allow users to catch subtle bugs in their code.
This topic was originally brought up in this thread: https://mail.python.org/pipermail/python-dev/2015-December/142443.html |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015年12月16日 21:46:57 | yselivanov | set | recipients:
+ yselivanov, gvanrossum, ncoghlan, vstinner, asvetlov |
| 2015年12月16日 21:46:57 | yselivanov | set | messageid: <1450302417.78.0.492418197951.issue25887@psf.upfronthosting.co.za> |
| 2015年12月16日 21:46:57 | yselivanov | link | issue25887 messages |
| 2015年12月16日 21:46:57 | yselivanov | create |
|