-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Add kind field to ast.Constant, to distinguish u"..." from "..." for type checkers #80461
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
Comments
Maybe use a special subclass of Constant for indicating string literals with the "u" prefix? |
That would indeed be more convenient, as it requires fewer code and test changes. Are there examples of such classes in Python.asdl? |
On second thought, even though it's a subclass, it feels less consistent than an extra attribute. So I'd rather keep the current approach (kind -> 'u' or None). |
Thanks for the review Serhiy! |
Please correct me if I'm wrong. This |
@vasily-v-ryabov What is your question, or what action are you requesting we take? |
@gvanrossum Initially I wanted to remove this field as it looked outdated. I've even prepared draft commit vasily-v-ryabov@68906e0 but then I've found this thread and related commits, and also I understood it may potentially break backward compatibility. If there is no such risk, I'd suggest to create a PR or prepare some deprecation. Though this particular commit is not critical to me if this stuff is really used. The reason to me is making AST more compact which should be generally good for performance. I'm interested in improvements for AST and compiler related stuff in CPython for my project (hope it will be open in the future). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: