Skip to content

Commit dd2faeb

Browse files
gh-90431: Document cancellation behavior of asyncio.wait() and asyncio.as_completed() (#153616)
1 parent 6081d16 commit dd2faeb

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
@@ -924,6 +924,9 @@ Waiting primitives
924924
Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the
925925
futures when a timeout occurs.
926926

927+
If ``wait()`` is cancelled, the futures in *aws* are not cancelled
928+
and continue to run.
929+
927930
.. versionchanged:: 3.10
928931
Removed the *loop* parameter.
929932

@@ -981,6 +984,10 @@ Waiting primitives
981984
are done. This is raised by the ``async for`` loop during asynchronous
982985
iteration or by the coroutines yielded during plain iteration.
983986

987+
``as_completed()`` does not cancel the tasks running the supplied
988+
awaitables: if a timeout occurs or the iteration is cancelled, the
989+
remaining tasks continue to run.
990+
984991
.. versionchanged:: 3.10
985992
Removed the *loop* parameter.
986993

0 commit comments

Comments
 (0)