bpo-31033: Add a msg argument to Future.cancel() and Task.cancel() (GH-19979)

This commit is contained in:
Chris Jerdonek 2020-05-15 16:55:50 -07:00 committed by GitHub
parent fe1176e882
commit 1ce5841eca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 355 additions and 70 deletions

View file

@ -724,7 +724,7 @@ Task Object
.. deprecated-removed:: 3.8 3.10
The *loop* parameter.
.. method:: cancel()
.. method:: cancel(msg=None)
Request the Task to be cancelled.
@ -739,6 +739,9 @@ Task Object
suppressing cancellation completely is not common and is actively
discouraged.
.. versionchanged:: 3.9
Added the ``msg`` parameter.
.. _asyncio_example_task_cancel:
The following example illustrates how coroutines can intercept