Skip to content

gh-148091: asyncio : clarify Future.cancel(msg) behaviour#148248

Open
manoj-k-m wants to merge 3 commits intopython:mainfrom
manoj-k-m:add-msg-explanation
Open

gh-148091: asyncio : clarify Future.cancel(msg) behaviour#148248
manoj-k-m wants to merge 3 commits intopython:mainfrom
manoj-k-m:add-msg-explanation

Conversation

@manoj-k-m
Copy link
Copy Markdown

@manoj-k-m manoj-k-m commented Apr 8, 2026

The msg parameter of Future.cancel() is currently undocumented.

This change clarifies that the optional msg argument is passed as the argument to asyncio.CancelledError raised when
a cancelled Future is awaited, and that it can be of any object.

Fixes #148091

skip news

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 8, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@manoj-k-m manoj-k-m changed the title asyncio : clarify Future.cancel(msg) behaviour gh-148091: asyncio : clarify Future.cancel(msg) behaviour Apr 8, 2026
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 8, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

1 similar comment
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 8, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@manoj-k-m
Copy link
Copy Markdown
Author

@bedevere-bot skip news

Copy link
Copy Markdown
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the asyncio documentation, not the docstring. We don't generate the documentation from docstrings.

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 8, 2026

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document how the msg parameter for asyncio.futures.Future.cancel is used

2 participants