Skip to content

Fix ClassDef Name binding#101

Merged
dflook merged 8 commits into
python312from
python312-class-names
Aug 31, 2024
Merged

Fix ClassDef Name binding#101
dflook merged 8 commits into
python312from
python312-class-names

Conversation

@dflook
Copy link
Copy Markdown
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
@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