Skip to content
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

Fix ClassDef Name binding #101

Merged
merged 8 commits into from
Aug 31, 2024
Merged

Fix ClassDef Name binding #101

merged 8 commits into from
Aug 31, 2024

Conversation

dflook
Copy link
Owner

@dflook dflook commented Aug 9, 2024

For names in a class namespace, that are used in a load context, place their NameBinding in non-local scope.

@dflook dflook force-pushed the python312-class-names branch from 0bb8649 to 0b71b70 Compare August 30, 2024 22:23
dflook added 2 commits August 31, 2024 09:30
These will become class attributes.
This fixes situations where renaming was allowed due to the actual namebinding being placed in a nonlocal scope by a name in load context in the class scope.
The previous checks were not enough, as name references we know are a builtin could get redefined in class scope.
@dflook dflook merged commit 333acfe into python312 Aug 31, 2024
75 checks passed
@dflook dflook deleted the python312-class-names branch August 31, 2024 17:25
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.

1 participant