-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
bpo-43897: Reject "_"
captures and top-level MatchStar
in the AST validator
#27432
Conversation
MatchStar
in the AST validator"_"
captures and top-level MatchStar
in the AST validator
Python/ast.c
Outdated
} | ||
|
||
static int | ||
validate_pattern(struct validator *state, pattern_ty p, int star_okay) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validate_pattern(struct validator *state, pattern_ty p, int star_okay) | |
validate_pattern(struct validator *state, pattern_ty p, int star_ok) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (beside star_ok
)
Regarding the backport to 3.10, I think it might make sense to hold this off until |
That's only after the first RC, right? I think a backport for this would be fine as long as it happened soon. |
That's correct, that is only after the first RC. Please, merge this as soon as possible so we can test it enough before we release the RC. Ideally someone has a fuzzer powerful enough to check the validator 😉 |
Windows (x86) failure looks unrelated. |
Thanks @brandtbucher for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
GH-27435 is a backport of this pull request to the 3.10 branch. |
…idator (pythonGH-27432) (cherry picked from commit 8d06474) Co-authored-by: Brandt Bucher <[email protected]>
…AST validator (GH-27432) (GH-27435) (cherry picked from commit 8d06474) Co-authored-by: Brandt Bucher <[email protected]> Automerge-Triggered-By: GH:brandtbucher
Also, remove an old comment and fix some recursion depth issues.
https://bugs.python.org/issue43897