-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
dataclass
is not Hashable
#11463
Comments
This happens because mypy/mypy/plugins/dataclasses.py Lines 123 to 128 in 2db0511
This should still be from dataclasses import dataclass
@dataclass(unsafe_hash=True)
class Some:
x: int
print(hash(Some(1))) # ok I will send a fix today. Thanks for the report! 👍 |
By the way, here's a note from the docs:
https://docs.python.org/3/library/dataclasses.html#dataclasses.dataclass So, it still might be hashable even without |
|
I will send a PR after #11483 is merged. I don't want to solve merge conflicts. |
Aren't the docs quite clear about this?
|
The text was updated successfully, but these errors were encountered: