Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ast: Remove 3 TypeAlias. Fix identifier collision. #14319

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 3 commits into from
Jun 22, 2025

Conversation

hunterhogan
Copy link
Contributor

Fix #14280

This comment has been minimized.

This comment has been minimized.

stdlib/ast.pyi Outdated
class match_case(AST):
__match_args__ = ("pattern", "guard", "body")
pattern: _Pattern
pattern: pattern
Copy link
Member

Choose a reason for hiding this comment

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

This is incorrect (even if type checkers currently allow it). The name pattern in the class namespace should refer to the pattern attribute, not the pattern class. Using ast.pattern might work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought it was odd that the type checkers didn't complain about these annotations, but I didn't change it because I was trying to change as little as possible.

Meta: I am not sure I am using this part of the GitHub tool correctly. The options say things like "View reviewed changes", then Review changes but there are no changes and VS Code wants me to Start Review of the thing I am viewing or make a code suggestion. One screen said "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo."

Copy link
Contributor

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

@JelleZijlstra JelleZijlstra merged commit d0f9f40 into python:main Jun 22, 2025
64 checks passed
@hunterhogan hunterhogan deleted the ast._Pattern branch June 23, 2025 02:09
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.

Who is the tool: the programmer or the program?
2 participants