Glenn Langford added the comment: Comments on @Victor's comments - I will have a look at the dev guide. :-)
I think you have identified another bug in the current code. "Future._waiters is a list and so accept duplicated waiters." What this means is that the following code is broken, because it attempts to remove the Future twice from the pending set. for future in finished: yield future pending.remove(future) ## KeyError triggered on as_completed( [f,f] ) See attached test which demonstrates the breakage. Also, the behaviour of as_completed([f,f]) and wait([f,f], return_when=ALL_COMPLETED) is currently different. wait will only yield f once. ---------- Added file: http://bugs.python.org/file33656/test_dupfuture.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20297> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com