]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-132354: document return value for `asyncio.Task.cancel` (#132374)
authorFelix Scherz <felixwscherz@gmail.com>
Sun, 13 Apr 2025 07:35:44 +0000 (09:35 +0200)
committerGitHub <noreply@github.com>
Sun, 13 Apr 2025 07:35:44 +0000 (13:05 +0530)
Doc/library/asyncio-task.rst
Misc/ACKS

index b6ae443860843b626ca4064e1e5651a76bbee409..59acce1990ae04775222fd2b51cbf4de8624b119 100644 (file)
@@ -1381,7 +1381,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 c3e8530d5b36c2690799c0fd2c2c953a437bfa54..25542d01de695c72994cf8ef90dd083d0a8b5b13 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1663,6 +1663,7 @@ Andreas Schawo
 Neil Schemenauer
 David Scherer
 Wolfgang Scherer
+Felix Scherz
 Hynek Schlawack
 Bob Schmertz
 Gregor Schmid