Yury Selivanov added the comment: > I haven't looked at the patch, but the intent to make the 2nd > await raise a RuntimeError seems strange for several reasons: > - it's inconsistent with the Future/Task interface;
Well, coroutines are much more lower level than Future/Tasks. > - it's quite common to await a 2nd time to get the coroutine > result after calling asyncio.wait(...) using ALL_COMPLETED or > FIRST_EXCEPTION; I believe you're not using the asyncio.task() function correctly. >From the docs: """Wait for the Futures and coroutine objects given by the sequence futures to complete. Coroutines will be wrapped in Tasks. Returns two sets of Future: (done, pending).""" > - as mentioned in the mailing list the await keyword in > C#/Hack/JS which inspired the await keyword (as per PEP492) > returns the result/exception multiple times. Yes, this was discussed at length on the mailing list. There are many reasons as to why we don't want coroutines to be awaitable many times. One of them is that we don't want low-level coroutine objects to hold references to return values. Coroutines in Python are exhaustible resources (like generators). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25887> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com