From: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Date: Mon, 24 Apr 2023 09:03:12 +0000 (+0530) Subject: [3.11] GH-78530: clarify docs for generators yielding tasks in `asyncio.wait` and... X-Git-Tag: v3.11.4~179 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=16dabf9e566297085ce5408bcaa7127439a01309;p=thirdparty%2FPython%2Fcpython.git [3.11] GH-78530: clarify docs for generators yielding tasks in `asyncio.wait` and `asyncio.as_completed` (#103748) --- 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 ` 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.