-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-122449: Use constants instead of hard-coded strings in Tools/cases_generator
#122448
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
Conversation
Tools/cases_generator
Tools/cases_generator
…-kind # Conflicts: # Tools/cases_generator/analyzer.py # Tools/cases_generator/generators_common.py
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.
Generally looks like a good refactoring, but I am not a code owner of this module, so I cannot make the full review.
@markshannon Are you interested in this kind of refactoring or not? if not, I'll close this one. (since you're mostly working in that area, your fingers may remember what to type so this PR could not be useful to you) |
Closing since this didn't attract enough attention. The work can always be restored later but conflicts are still annoying to fix. |
This is a small PR for avoiding using hardcoded token's kind. By the way, I observed something weird: In
always_exits
ofanalyzer.py
we havecpython/Tools/cases_generator/analyzer.py
Lines 537 to 542 in d27a53f
but a token kind set to "KEYWORD" does not exist (I added the constant but did not use it at all and I don't know how you could create one of that kind). I assume that the test should instead be something like
tkn.kind in lx.keywords.values()
instead but I would like confirmation on that matter.I did not touch the kind of a Node since they are already literals (and mypy would then comply if something is wrong).
Tools/cases_generator
#122449