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

Skip to content

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

Closed
wants to merge 2 commits into from

Conversation

hunterhogan
Copy link
Contributor

@hunterhogan hunterhogan commented Jun 21, 2025

Copy link
Member

@terryjreedy terryjreedy left a 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.

@bedevere-app
Copy link

bedevere-app bot commented Jun 22, 2025

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

empty_tuple = PyTuple_New(0);
if (!empty_tuple ||
empty_dict = PyDict_New();
Copy link
Member

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.

@JelleZijlstra
Copy link
Member

I'm OK with adding this in 3.15 but please add a test.

@hunterhogan
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants