From 64b066ad298506f715647c9a2524c9fbbc764cc2 Mon Sep 17 00:00:00 2001 From: Felix Scherz Date: Sun, 13 Apr 2025 09:35:44 +0200 Subject: gh-132354: document return value for `asyncio.Task.cancel` (#132374) --- Doc/library/asyncio-task.rst | 5 ++++- Misc/ACKS | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index b6ae443..59acce1 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 c3e8530..25542d0 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 -- cgit v0.12