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

uuid: mark setattr #7347

Closed
wants to merge 1 commit into from
Closed

uuid: mark setattr #7347

wants to merge 1 commit into from

Conversation

hauntsaninja
Copy link
Collaborator

No description provided.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood
Copy link
Member

What does this do for us? mypy will already raise an error if a user tries to set an attribute on an object that hasn't been formally declared as an attribute of that object. And we already have all instance attributes on this class as read-only properties.

@hauntsaninja
Copy link
Collaborator Author

It doesn't do much, beyond mypy understanding what happens if you do UUID.__setattr__("attr", 5).
I was looking at this because it's one of the new errors from python/mypy#12203.

@hauntsaninja
Copy link
Collaborator Author

Actually no, this makes things worse, since mypy will give you worse (and depending on settings, sometimes no) diagnostics if you do u.doesnt_exist = 3

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.

None yet

2 participants