GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-135797 Add default empty dict for ast._field_types attribute. by hunterhogan · Pull Request #135800 · python/cpython

Conversation

@hunterhogan

@hunterhogan hunterhogan commented Jun 21, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: ast.class._field_types causes Exception when ast.class._fields does not cause Exception #135797

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hunterhogan
Add _field_types attribute to AST class.
1d9e74a
@hunterhogan
hunterhogan requested review from Eclips4, JelleZijlstra, ericsnowcurrently, isidentical and tomasr8 as code owners June 21, 2025 21:43
@bedevere-app bedevere-app Bot added the awaiting review label Jun 21, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Jun 21, 2025
ast.class._field_types causes Exception when ast.class._fields does not cause Exception #135797
Open
brianschubert
brianschubert reviewed Jun 21, 2025
View reviewed changes
Comment thread Parser/asdl_c.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@hunterhogan
As requested, reverting Ruff E703: Statement ends with an unnecessary…
e3bfe0f
… semicolon.
terryjreedy
terryjreedy requested changes Jun 22, 2025
View reviewed changes

@terryjreedy terryjreedy left a comment

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot removed the awaiting review label Jun 22, 2025
@bedevere-app

bedevere-app Bot commented Jun 22, 2025

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added the awaiting changes label Jun 22, 2025
JelleZijlstra
JelleZijlstra reviewed Jun 22, 2025
View reviewed changes
Comment thread Parser/asdl_c.py
PyObject *empty_tuple, *empty_dict;
empty_tuple = PyTuple_New(0);
if (!empty_tuple ||
empty_dict = PyDict_New();

@JelleZijlstra JelleZijlstra Jun 22, 2025

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JelleZijlstra

JelleZijlstra commented Jun 22, 2025

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hunterhogan

hunterhogan commented Jun 22, 2025

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hunterhogan hunterhogan closed this Jun 22, 2025
@hunterhogan
hunterhogan deleted the ast_field_types branch September 21, 2025 04:46
@Wojusensei Wojusensei mentioned this pull request Nov 9, 2026
gh-135797: Add _field_types to abstract AST classes #159567
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra JelleZijlstra left review comments
@brianschubert brianschubert brianschubert left review comments
@terryjreedy terryjreedy terryjreedy requested changes
@isidentical isidentical Awaiting requested review from isidentical
@Eclips4 Eclips4 Awaiting requested review from Eclips4
@tomasr8 tomasr8 Awaiting requested review from tomasr8
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting changes

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@hunterhogan @JelleZijlstra @terryjreedy @brianschubert
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.