-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Error on instance property and init-only variable with the same name in a dataclass #12046
Comments
This is a problem with mypy's dataclasses plugin, I suppose. However, as mypy would have already processed the class (I think?) before the plugin gets to it, I'm not certain it can be fixed. I suppose the workaround would be to |
Thanks. I'll implement the suggest workaround. |
I also get |
e.g.
results in |
Maybe if |
Bug Report
Consider the following class definition:
Mypy reports an error on line 10:
Name "prop" already defined on line 4
.Is this a false positive? If not, how can I avoid this short of renaming the "
prop
" attribute or getter method (or using#typing: ignore
)?Environment
The text was updated successfully, but these errors were encountered: