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

Fix crash on overriding with frozen attrs #14186

Merged
merged 2 commits into from
Nov 25, 2022

Conversation

ilevkivskyi
Copy link
Member

Fixes #6715

Fix is straightforward, currently we assume that if we have a variable in MRO, and its name appears in current class, it is from this class, which in fact may not be the case when a variable is overridden with a property or method.

I also add a test case for a crash that was previously reported in the same issue but is already (accidentally?) fixed.

@github-actions
Copy link
Contributor

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

@ilevkivskyi ilevkivskyi merged commit 278a095 into python:master Nov 25, 2022
@ilevkivskyi ilevkivskyi deleted the fix-attrs-crash branch November 25, 2022 17:27
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.

Mypy crash when @staticmethod has the same name as an attr
2 participants