Skip to content

Commit

Permalink
bpo-40405: Fix asyncio.as_completed docs (GH-19753)
Browse files Browse the repository at this point in the history
* Fix as_completed docs to correctly state the function return value.
* Also, improves the general wording of the as_completed documentation.

Co-Authored-By: Rémi Lapeyre <remi.lapeyre@henki.fr>
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
Co-Authored-By: Yury Selivanov <yury@edgedb.com>
(cherry picked from commit 13206b5)

Co-authored-by: Bar Harel <bzvi7919@gmail.com>
  • Loading branch information
miss-islington and bharel committed May 23, 2020
1 parent dc32391 commit 2fecb48
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Doc/library/asyncio-task.rst
Expand Up @@ -580,9 +580,9 @@ Waiting Primitives
.. function:: as_completed(aws, \*, loop=None, timeout=None)

Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
set concurrently. Return an iterator of :class:`Future` objects.
Each Future object returned represents the earliest result
from the set of the remaining awaitables.
set concurrently. Return an iterator of coroutines.
Each coroutine returned can be awaited to get the earliest next
result from the set of the remaining awaitables.

Raises :exc:`asyncio.TimeoutError` if the timeout occurs before
all Futures are done.
Expand All @@ -592,8 +592,8 @@ Waiting Primitives

Example::

for f in as_completed(aws):
earliest_result = await f
for coro in as_completed(aws):
earliest_result = await coro
# ...


Expand Down

0 comments on commit 2fecb48

Please sign in to comment.