[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

Guido van Rossum report at bugs.python.org
Thu Jan 23 16:47:38 CET 2014


Guido van Rossum added the comment:

I think you the caller was wrong to pass in [f, f] in the first place.

In asyncio, the argument is converted into a set before using it, but there's still a bug if you pass it a list containing two references to the same coroutine -- it gets wrapped in two separate Futures. I think the better behavior is to convert to a set first and then map coroutines to Futures.

So concurrent.futures should also convert to a set first.

----------

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


More information about the Python-bugs-list mailing list