Skip to content

[mypyc] Fix is_native_ref_expr for class attrs #18031

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

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

jhance
Copy link
Collaborator

@jhance jhance commented Oct 24, 2024

This addresses mypyc/mypyc#932 in which
in some cases before we were incorrectly not determining that the symbol was native.

Because the problematic implementation of is_native_ref_expr is present in multiple places,
the one in builder.py is rewritten to use the one in mapper.py.

Additional run tests are added to cover the case. Use of a dictionary here prevents falling
under a secondary, more optimized codepath, that avoided the issue entirely.

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@JukkaL JukkaL merged commit 376e2ad into python:master Oct 25, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants