diff options
author | Vinay Sharma <vinay04sharma@icloud.com> | 2020-07-20 08:42:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-20 08:42:57 (GMT) |
commit | d42528a3a2c7d79fd2e6c9f2a02f3ce12d44c8cc (patch) | |
tree | ea20708ad299c206a27218f7738b0d07b0648b85 /Doc/library/asyncio-task.rst | |
parent | 7f03445d01d5ece41c2ceef7254002e08e8ab5a5 (diff) | |
download | cpython-d42528a3a2c7d79fd2e6c9f2a02f3ce12d44c8cc.zip cpython-d42528a3a2c7d79fd2e6c9f2a02f3ce12d44c8cc.tar.gz cpython-d42528a3a2c7d79fd2e6c9f2a02f3ce12d44c8cc.tar.bz2 |
bpo-37703: improve asyncio.gather documentation regarding cancellation (GH-15312)
These changes updates the doc to comprehensively mention the behaviour of gather.cancel()
Automerge-Triggered-By: @asvetlov
Diffstat (limited to 'Doc/library/asyncio-task.rst')
-rw-r--r-- | Doc/library/asyncio-task.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index bac99b7..99f0125 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -387,6 +387,14 @@ Running Tasks Concurrently # Task C: Compute factorial(4)... # Task C: factorial(4) = 24 + .. note:: + If *return_exceptions* is False, cancelling gather() after it + has been marked done won't cancel any submitted awaitables. + For instance, gather can be marked done after propagating an + exception to the caller, therefore, calling ``gather.cancel()`` + after catching an exception (raised by one of the awaitables) from + gather won't cancel any other awaitables. + .. versionchanged:: 3.7 If the *gather* itself is cancelled, the cancellation is propagated regardless of *return_exceptions*. |