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

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
(cherry picked from commit f00645d5db)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Miss Islington (bot) 2022-10-01 11:10:04 -07:00 committed by GitHub
parent 95609525de
commit 3614bbb8eb
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.
"""