[Python-checkins] bpo-40405: Fix asyncio.as_completed docs (GH-19753)
Miss Islington (bot)
webhook-mailer at python.org
Sat May 23 19:24:07 EDT 2020
https://github.com/python/cpython/commit/2fecb48a1d84190c37214eb4b0c8d5460300a78b
commit: 2fecb48a1d84190c37214eb4b0c8d5460300a78b
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-05-23T16:24:03-07:00
summary:
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 <remi.lapeyre at henki.fr>
Co-Authored-By: Kyle Stanley <aeros167 at gmail.com>
Co-Authored-By: Yury Selivanov <yury at edgedb.com>
(cherry picked from commit 13206b52d16c2489f4c7dd2dce2a7f48a554b5ed)
Co-authored-by: Bar Harel <bzvi7919 at gmail.com>
files:
M Doc/library/asyncio-task.rst
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
index 1a23661fc772e..00ce5d4b72bdd 100644
--- a/Doc/library/asyncio-task.rst
+++ b/Doc/library/asyncio-task.rst
@@ -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.
@@ -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
# ...
More information about the Python-checkins
mailing list