KEMBAR78
[mypyc] Fix `setup` conflict when setting an attribute with name `up` by davfsa · Pull Request #13012 · python/mypy · GitHub
Skip to content

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