]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-90431: Document cancellation behavior of asyncio.wait() and asyncio.as_completed...
authorKumar Aditya <kumaraditya@python.org>
Sun, 12 Jul 2026 10:54:42 +0000 (16:24 +0530)
committerGitHub <noreply@github.com>
Sun, 12 Jul 2026 10:54:42 +0000 (10:54 +0000)
Doc/library/asyncio-task.rst

index 64f0810777e41b93251db1a05c4f865fdd4f1534..d0cd241e42db268c5542d5f18c455a82761a30a3 100644 (file)
@@ -924,6 +924,9 @@ Waiting primitives
    Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the
    futures when a timeout occurs.
 
+   If ``wait()`` is cancelled, the futures in *aws* are not cancelled
+   and continue to run.
+
    .. versionchanged:: 3.10
       Removed the *loop* parameter.
 
@@ -981,6 +984,10 @@ Waiting primitives
    are done. This is raised by the ``async for`` loop during asynchronous
    iteration or by the coroutines yielded during plain iteration.
 
+   ``as_completed()`` does not cancel the tasks running the supplied
+   awaitables: if a timeout occurs or the iteration is cancelled, the
+   remaining tasks continue to run.
+
    .. versionchanged:: 3.10
       Removed the *loop* parameter.