-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-135797 Add default empty dict for ast._field_types attribute. #135800
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
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.
See the issue for whether this new feature should be added. -1 until there is a positive coredev decision to do do.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
empty_tuple = PyTuple_New(0); | ||
if (!empty_tuple || | ||
empty_dict = PyDict_New(); |
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.
I think this is technically unsafe: if PyTuple_New raised an exception, we can't generally call other C API functions with an exception set. Safer to have a separate if statement for the dict.
I'm OK with adding this in 3.15 but please add a test. |
Someone with more skill than I have should make these changes. |
ast.class._field_types
causes Exception whenast.class._fields
does not cause Exception #135797