[Python-checkins] [3.11] GH-78530: clarify docs for generators yielding tasks in `asyncio.wait` and `asyncio.as_completed` (#103748)

kumaraditya303 webhook-mailer at python.org
Mon Apr 24 05:03:20 EDT 2023


https://github.com/python/cpython/commit/16dabf9e566297085ce5408bcaa7127439a01309
commit: 16dabf9e566297085ce5408bcaa7127439a01309
branch: 3.11
author: Kumar Aditya <59607654+kumaraditya303 at users.noreply.github.com>
committer: kumaraditya303 <59607654+kumaraditya303 at users.noreply.github.com>
date: 2023-04-24T14:33:12+05:30
summary:

[3.11] GH-78530: clarify docs for generators yielding tasks in `asyncio.wait` and `asyncio.as_completed` (#103748)

files:
M Doc/library/asyncio-task.rst

diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
index 02fc38495879..bfefe8e3815b 100644
--- a/Doc/library/asyncio-task.rst
+++ b/Doc/library/asyncio-task.rst
@@ -757,7 +757,7 @@ Waiting Primitives
    iterable concurrently and block until the condition specified
    by *return_when*.
 
-   The *aws* iterable must not be empty.
+   The *aws* iterable must not be empty and generators yielding tasks are not accepted.
 
    Returns two sets of Tasks/Futures: ``(done, pending)``.
 
@@ -805,7 +805,8 @@ Waiting Primitives
 .. function:: as_completed(aws, *, timeout=None)
 
    Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
-   iterable concurrently.  Return an iterator of coroutines.
+   iterable concurrently. Generators yielding tasks are not accepted
+   as *aws* iterable. Return an iterator of coroutines.
    Each coroutine returned can be awaited to get the earliest next
    result from the iterable of the remaining awaitables.
 



More information about the Python-checkins mailing list