]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-132354: document return value for `asyncio.Task.cancel` (GH-132374) (#132465)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 13 Apr 2025 07:41:26 +0000 (09:41 +0200)
committerGitHub <noreply@github.com>
Sun, 13 Apr 2025 07:41:26 +0000 (07:41 +0000)
gh-132354: document return value for `asyncio.Task.cancel` (GH-132374)
(cherry picked from commit 64b066ad298506f715647c9a2524c9fbbc764cc2)

Co-authored-by: Felix Scherz <felixwscherz@gmail.com>
Doc/library/asyncio-task.rst
Misc/ACKS

index ddba9f20a3c03b6d06ad2e4d4c6e2235f1d4d5b1..6c83ab94af39555555124f3a4da5bd1c090bffae 100644 (file)
@@ -1336,7 +1336,10 @@ Task Object
 
       Request the Task to be cancelled.
 
-      This arranges for a :exc:`CancelledError` exception to be thrown
+      If the Task is already *done* or *cancelled*, return ``False``,
+      otherwise, return ``True``.
+
+      The method arranges for a :exc:`CancelledError` exception to be thrown
       into the wrapped coroutine on the next cycle of the event loop.
 
       The coroutine then has a chance to clean up or even deny the
index f236c6400c2b303053662e950cc3dcc900f09b33..3adb168f33c40a63de93c2124919cf05e51c976d 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1644,6 +1644,7 @@ Andreas Schawo
 Neil Schemenauer
 David Scherer
 Wolfgang Scherer
+Felix Scherz
 Hynek Schlawack
 Bob Schmertz
 Gregor Schmid