Skip to content

Commit ff1c2b7

Browse files
[3.13] gh-90431: Document cancellation behavior of asyncio.wait() and asyncio.as_completed() (GH-153616) (#153619)
gh-90431: Document cancellation behavior of asyncio.wait() and asyncio.as_completed() (GH-153616) (cherry picked from commit dd2faeb) Co-authored-by: Kumar Aditya <kumaraditya@python.org>
1 parent 511a751 commit ff1c2b7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Doc/library/asyncio-task.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,9 @@ Waiting primitives
929929
Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the
930930
futures when a timeout occurs.
931931

932+
If ``wait()`` is cancelled, the futures in *aws* are not cancelled
933+
and continue to run.
934+
932935
.. versionchanged:: 3.10
933936
Removed the *loop* parameter.
934937

@@ -986,6 +989,10 @@ Waiting primitives
986989
are done. This is raised by the ``async for`` loop during asynchronous
987990
iteration or by the coroutines yielded during plain iteration.
988991

992+
``as_completed()`` does not cancel the tasks running the supplied
993+
awaitables: if a timeout occurs or the iteration is cancelled, the
994+
remaining tasks continue to run.
995+
989996
.. versionchanged:: 3.10
990997
Removed the *loop* parameter.
991998

0 commit comments

Comments
 (0)