From: Felix Scherz Date: Sun, 13 Apr 2025 07:35:44 +0000 (+0200) Subject: gh-132354: document return value for `asyncio.Task.cancel` (#132374) X-Git-Tag: v3.14.0b1~507 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64b066ad298506f715647c9a2524c9fbbc764cc2;p=thirdparty%2FPython%2Fcpython.git gh-132354: document return value for `asyncio.Task.cancel` (#132374) --- diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index b6ae44386084..59acce1990ae 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -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 diff --git a/Misc/ACKS b/Misc/ACKS index c3e8530d5b36..25542d01de69 100644 --- 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