[issue26357] asyncio.wait loses coroutine return value

Guido van Rossum report at bugs.python.org
Sat Feb 13 19:20:10 EST 2016


Guido van Rossum added the comment:

I wonder if the right solution isn't to insist that the arguments to await() are Futures, not coroutines. While in many cases (e.g. gather(), wait_for()) it's a useful convention to support either coroutines or Futures, for wait() it does seem pretty useless. Mapping the Futures back to coroutines isn't a good solution either, since you can't get the result out of just the coroutine.

The question is whether we can just change this or whether we should issue some kind of deprecation warning, since it's at least conceivable that someone relies on the current behavior and doesn't care about mapping results back to coroutines (e.g. if the results are self-identifying).

The same issue applies to as_completed(), I think.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26357>
_______________________________________


More information about the Python-bugs-list mailing list