New submission from Bar Harel <bzvi7...@gmail.com>:

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

----------
assignee: docs@python
components: Documentation, asyncio
messages: 367410
nosy: aronacher, asvetlov, bar.harel, docs@python, gvanrossum, hynek, vstinner, 
xtreak, yselivanov
priority: normal
severity: normal
status: open
title: ast
versions: Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40405>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to