Skip to content

[mypyc] Fix setup conflict when setting an attribute with name up #13012

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 1 commit into from
Jul 17, 2022

Conversation

davfsa
Copy link
Contributor

@davfsa davfsa commented Jun 23, 2022

Description

Fixes mypyc/mypyc#933 by preventing the conflicting set(up) name. getter_name has also been changed for consistency sake.

Test Plan

Test cases added to test_emitclass.py

@JelleZijlstra
Copy link
Member

Won't this break for an attribute named _up instead?

@davfsa
Copy link
Contributor Author

davfsa commented Jun 23, 2022

Won't this break for an attribute named _up instead?

No, as the function call will then be (taking the same examples there are in the tests) testing___SomeClass_set__up, which shouldn't be an issue

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Thanks, this seems reasonable!

@hauntsaninja hauntsaninja merged commit 3e978b2 into python:master Jul 17, 2022
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.

Member variable "up" causes name collision
4 participants