This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 <>
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:
Date User Action Args
2015-12-16 21:46:57yselivanovsetrecipients: + yselivanov, gvanrossum, ncoghlan, vstinner, asvetlov
2015-12-16 21:46:57yselivanovsetmessageid: <>
2015-12-16 21:46:57yselivanovlinkissue25887 messages
2015-12-16 21:46:57yselivanovcreate