aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/asyncio/tasks.py
diff options
context:
space:
mode:
authorƁukasz Langa <lukasz@langa.pl>2022-10-01 19:42:36 +0200
committerGitHub <noreply@github.com>2022-10-01 10:42:36 -0700
commitf00645d5dbf4cfa0b8f382c8977724578dff191d (patch)
treec9e2f139bba2c68895d178c46c75a9ef9690ee39 /Lib/asyncio/tasks.py
parent273a819ed2c927ed205ff334ea997cb62b1d20af (diff)
downloadcpython-f00645d5dbf4cfa0b8f382c8977724578dff191d.tar.gz
cpython-f00645d5dbf4cfa0b8f382c8977724578dff191d.zip
gh-90908: Document asyncio.Task.cancelling() and asyncio.Task.uncancel() (#95253)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Diffstat (limited to 'Lib/asyncio/tasks.py')
-rw-r--r--Lib/asyncio/tasks.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index 56a355cbdc7..e48da0f2008 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -243,8 +243,8 @@ class Task(futures._PyFuture): # Inherit Python Task implementation
def uncancel(self):
"""Decrement the task's count of cancellation requests.
- This should be used by tasks that catch CancelledError
- and wish to continue indefinitely until they are cancelled again.
+ This should be called by the party that called `cancel()` on the task
+ beforehand.
Returns the remaining number of cancellation requests.
"""