Skip to content

Bump pyflakes to 3.4.* #14316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 30, 2025
Merged

Bump pyflakes to 3.4.* #14316

merged 4 commits into from
Jun 30, 2025

Conversation

donBarbos
Copy link
Contributor

Closes: #14314

This comment has been minimized.

This comment has been minimized.

Copy link
Member

@brianschubert brianschubert left a comment

Choose a reason for hiding this comment

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

Nice, LGTM :-)

@donBarbos donBarbos changed the title Bump pyflakes to ~=3.4.0 Bump pyflakes to 3.4.* Jun 21, 2025
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Comment on lines +316 to +317
def TEMPLATESTR(self, node: _TemplateStr) -> None: ...
def INTERPOLATION(self, tree: _Interpolation, omit: _OmitType = None) -> None: ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of type aliases, would it be better to put the if statements directly here, like this?

Suggested change
def TEMPLATESTR(self, node: _TemplateStr) -> None: ...
def INTERPOLATION(self, tree: _Interpolation, omit: _OmitType = None) -> None: ...
if sys.version_info >= (3, 14):
def TEMPLATESTR(self, node: ast.TemplateStr) -> None: ...
def INTERPOLATION(self, tree: ast.Interpolation, omit: _OmitType = None) -> None: ...
else:
# The methods using these should never be called on Python < 3.14.
def TEMPLATESTR(self, node: Never) -> None: ...
def INTERPOLATION(self, tree: Never, omit: _OmitType = None) -> None: ...

This way IDE users will see ast.TemplateStr instead of _TemplateStr in hover tooltips and such. Type checker error messages will also be better.

The downside is that overriding the method is more difficult, but to me it seems like it's not meant to be overwritten.

Copy link
Contributor Author

@donBarbos donBarbos Jun 30, 2025

Choose a reason for hiding this comment

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

good idea, but the practice of using type aliases has developed before

we can suggest doing this in a separate PR/issue for the entire file (I think this would be more correct)

@Akuli Akuli merged commit 5870a23 into python:main Jun 30, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants