diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-05-23 23:23:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-23 23:23:53 (GMT) |
commit | 9181e2e2f3ade85f65bf2521a5deb898434dfd64 (patch) | |
tree | 481d6a3dc92b08605231189b0307ef2ecc37b5e6 /Doc | |
parent | 962c814ca77fb1873908f2daeda59c2637ad3bf1 (diff) | |
download | cpython-9181e2e2f3ade85f65bf2521a5deb898434dfd64.zip cpython-9181e2e2f3ade85f65bf2521a5deb898434dfd64.tar.gz cpython-9181e2e2f3ade85f65bf2521a5deb898434dfd64.tar.bz2 |
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@henki.fr>
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
Co-Authored-By: Yury Selivanov <yury@edgedb.com>
(cherry picked from commit 13206b52d16c2489f4c7dd2dce2a7f48a554b5ed)
Co-authored-by: Bar Harel <bzvi7919@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/asyncio-task.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index dd94c14..847363b 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -585,9 +585,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. @@ -597,8 +597,8 @@ Waiting Primitives Example:: - for f in as_completed(aws): - earliest_result = await f + for coro in as_completed(aws): + earliest_result = await coro # ... |