mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-46829: Deprecate passing a message into Future.cancel() and Task.cancel() (GH-31840)
After a long deliberation we ended up feeling that the message argument for Future.cancel(), added in 3.9, was a bad idea, so we're deprecating it in 3.11 and plan to remove it in 3.13.
This commit is contained in:
parent
624e3986fb
commit
0360e9f346
9 changed files with 106 additions and 17 deletions
|
@ -196,6 +196,11 @@ Future Object
|
|||
.. versionchanged:: 3.9
|
||||
Added the *msg* parameter.
|
||||
|
||||
.. deprecated-removed:: 3.11 3.14
|
||||
*msg* parameter is ambiguous when multiple :meth:`cancel`
|
||||
are called with different cancellation messages.
|
||||
The argument will be removed.
|
||||
|
||||
.. method:: exception()
|
||||
|
||||
Return the exception that was set on this Future.
|
||||
|
@ -276,3 +281,8 @@ the Future has a result::
|
|||
|
||||
- :meth:`asyncio.Future.cancel` accepts an optional ``msg`` argument,
|
||||
but :func:`concurrent.futures.cancel` does not.
|
||||
|
||||
.. deprecated-removed:: 3.11 3.14
|
||||
*msg* parameter is ambiguous when multiple :meth:`cancel`
|
||||
are called with different cancellation messages.
|
||||
The argument will be removed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue