This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bar.harel
Recipients aronacher, asvetlov, bar.harel, docs@python, gvanrossum, hynek, vstinner, xtreak, yselivanov
Date 2020-04-27.11:14:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1587986090.72.0.850288416668.issue40405@roundup.psfhosted.org>
In-reply-to
Content
Continuing with bpo-27589, looks like as_completed documentation is still misleading. According to the docs, it "Return(s) an iterator of Future objects. Each Future object returned represents the earliest result from the set of the remaining awaitables."

There's only one problem: The only thing it definitely doesn't do, is return an iterator of future objects. To be honest with you, I'm not entirely sure how to phrase it.

For reference, I fell for this:

mapping = {fut: index for fut, index in enumerate(futures)}
for fut in as_completed(mapping):
  mapping[fut]  # KeyError
History
Date User Action Args
2020-04-27 11:14:50bar.harelsetrecipients: + bar.harel, gvanrossum, vstinner, aronacher, asvetlov, docs@python, hynek, yselivanov, xtreak
2020-04-27 11:14:50bar.harelsetmessageid: <1587986090.72.0.850288416668.issue40405@roundup.psfhosted.org>
2020-04-27 11:14:50bar.harellinkissue40405 messages
2020-04-27 11:14:49bar.harelcreate