Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed docstring from Lib/asyncio/futures.py and added it in Doc/lib…
…rary/asyncio-future.rst
  • Loading branch information
Manoj committed Apr 9, 2026
commit 98cd575646889a51136e10a9212161f5f32d601c
4 changes: 4 additions & 0 deletions Doc/library/asyncio-future.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ Future Object
If the Future is already *done* or *cancelled*, return ``False``.
Otherwise, change the Future's state to *cancelled*,
schedule the callbacks, and return ``True``.

The optional argument *msg* is passed as the argument to the
:exc:`CancelledError` exception raised when a cancelled Future
is awaited. It can be any object.
Comment thread
kumaraditya303 marked this conversation as resolved.
Outdated

.. versionchanged:: 3.9
Added the *msg* parameter.
Expand Down
4 changes: 0 additions & 4 deletions Lib/asyncio/futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,6 @@ def cancel(self, msg=None):
If the future is already done or cancelled, return False. Otherwise,
change the future's state to cancelled, schedule the callbacks and
return True.

The optional argument *msg* is passed as the argument to the
asyncio.CancelledError exception raised when a cancelled Future
is awaited. It can be any object.
"""
self.__log_traceback = False
if self._state != _PENDING:
Expand Down
Loading