STINNER Victor added the comment: Hum, you should also modify the documentation to explicit the behaviour. Example: "Duplicates futures are only yielded once".
You may add the same sentence in the asyncio.as_completed() documentation. It looks like asyncio tests doesn't test as_completed() with duplicated future. You may write a new patch to modify asyncio doc and tests. It should be very similar. + completed = [f for f in futures.as_completed( [f1,f1] ) ] You can just use list(futures.as_completed([f1,f1])). Please no space around parenthesis (see the PEP 8). + self.assertEqual( len(completed), 1 ) No space around parenthesis (see the PEP 8): self.assertEqual(len(completed), 1). You may check the list value instead: self.assertEqual(completed, [f1]) (Why "f1" name? There is no f2, maybe rename to f?) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20367> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com