KEMBAR78
[mypyc] Reject instance attribute access through class object by JukkaL · Pull Request #10798 · python/mypy · GitHub
Skip to content

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Jul 10, 2021

Accessing an instance attribute through a native class object results in
unexpected behavior at runtime (e.g. <attribute 'x' of 'C' objects>)
so reject these during compilation.

Also produce a note that suggests how to work around the issue.

Fixes mypyc/mypyc#814.

JukkaL added 6 commits July 10, 2021 13:23
Accessing an instance attribute through a native class object results in
unexpected behavior at runtime (e.g. `<attribute 'x' of 'C' objects>`)
so reject these during compilation.

Also a note that suggests how to work around the issue.

Fixes mypyc/mypyc#814.
@JukkaL JukkaL requested a review from msullivan July 10, 2021 12:49
@JukkaL JukkaL merged commit a37c388 into master Jul 10, 2021
@JukkaL JukkaL deleted the bad-class-var branch July 10, 2021 19:01
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.

behaviour of default values for class attributes differs from CPython

2 participants