gh-90908: Document asyncio.Task.cancelling() and asyncio.Task.uncancel() (#95253)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
This commit is contained in:
Łukasz Langa 2022-10-01 19:42:36 +02:00 committed by GitHub
parent 273a819ed2
commit f00645d5db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 256 additions and 82 deletions

View file

@ -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.
"""