Skip to content

Commit 13206b5

Browse files
bharelRémi Lapeyreaeros1st1
authored
bpo-40405: Fix asyncio.as_completed docs (GH-19753)
* 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 <[email protected]> Co-Authored-By: Kyle Stanley <[email protected]> Co-Authored-By: Yury Selivanov <[email protected]>
1 parent 1cba1c9 commit 13206b5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Doc/library/asyncio-task.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,9 @@ Waiting Primitives
585585
.. function:: as_completed(aws, \*, loop=None, timeout=None)
586586

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

592592
Raises :exc:`asyncio.TimeoutError` if the timeout occurs before
593593
all Futures are done.
@@ -597,8 +597,8 @@ Waiting Primitives
597597

598598
Example::
599599

600-
for f in as_completed(aws):
601-
earliest_result = await f
600+
for coro in as_completed(aws):
601+
earliest_result = await coro
602602
# ...
603603

604604

0 commit comments

Comments
 (0)