Skip to content

Commit 64b066a

Browse files
authored
gh-132354: document return value for asyncio.Task.cancel (#132374)
1 parent f69b344 commit 64b066a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Doc/library/asyncio-task.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,10 @@ Task Object
13811381

13821382
Request the Task to be cancelled.
13831383

1384-
This arranges for a :exc:`CancelledError` exception to be thrown
1384+
If the Task is already *done* or *cancelled*, return ``False``,
1385+
otherwise, return ``True``.
1386+
1387+
The method arranges for a :exc:`CancelledError` exception to be thrown
13851388
into the wrapped coroutine on the next cycle of the event loop.
13861389

13871390
The coroutine then has a chance to clean up or even deny the

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,6 +1663,7 @@ Andreas Schawo
16631663
Neil Schemenauer
16641664
David Scherer
16651665
Wolfgang Scherer
1666+
Felix Scherz
16661667
Hynek Schlawack
16671668
Bob Schmertz
16681669
Gregor Schmid

0 commit comments

Comments
 (0)