diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2020-05-15 23:55:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-15 23:55:50 (GMT) |
commit | 1ce5841eca6d96b1b1e8c213d04f2e92b1619bb5 (patch) | |
tree | 9fe492d885e1a0d660be4d96fb92b5f563aec99e /Doc/library/asyncio-future.rst | |
parent | fe1176e882393b6d3e6a6cfa5ca23657f0b3b4a9 (diff) | |
download | cpython-1ce5841eca6d96b1b1e8c213d04f2e92b1619bb5.zip cpython-1ce5841eca6d96b1b1e8c213d04f2e92b1619bb5.tar.gz cpython-1ce5841eca6d96b1b1e8c213d04f2e92b1619bb5.tar.bz2 |
bpo-31033: Add a msg argument to Future.cancel() and Task.cancel() (GH-19979)
Diffstat (limited to 'Doc/library/asyncio-future.rst')
-rw-r--r-- | Doc/library/asyncio-future.rst | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/library/asyncio-future.rst b/Doc/library/asyncio-future.rst index 832d581..e1ac18e 100644 --- a/Doc/library/asyncio-future.rst +++ b/Doc/library/asyncio-future.rst @@ -170,7 +170,7 @@ Future Object Returns the number of callbacks removed, which is typically 1, unless a callback was added more than once. - .. method:: cancel() + .. method:: cancel(msg=None) Cancel the Future and schedule callbacks. @@ -178,6 +178,9 @@ Future Object Otherwise, change the Future's state to *cancelled*, schedule the callbacks, and return ``True``. + .. versionchanged:: 3.9 + Added the ``msg`` parameter. + .. method:: exception() Return the exception that was set on this Future. @@ -255,3 +258,6 @@ the Future has a result:: - asyncio Future is not compatible with the :func:`concurrent.futures.wait` and :func:`concurrent.futures.as_completed` functions. + + - :meth:`asyncio.Future.cancel` accepts an optional ``msg`` argument, + but :func:`concurrent.futures.cancel` does not. |