You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MyPy doesn't seem to understand that dataclasses can generate an __eq__ method. If it's required (such as in an ABC), then it doesn't know that it was created.
I can confirm the issue. I may be wrong, but I think it might be related to #8638. Could it be that the code for dataclass.__eq__ was simply removed without being reworked?
Bug Report
MyPy doesn't seem to understand that dataclasses can generate an
__eq__
method. If it's required (such as in an ABC), then it doesn't know that it was created.To Reproduce
Gist URL: https://gist.github.com/89d988a5c8d37bd10d17445d5e344e63
Playground URL: https://mypy-play.net/?mypy=latest&python=3.10&gist=89d988a5c8d37bd10d17445d5e344e63
Expected Behavior
This should pass. It does at runtime. dataclasses do add
__eq__
unlesseq=False
.Actual Behavior
Your Environment
mypy.ini
(and other config files): NoneI didn't see any other issues that were exactly this issue.
The text was updated successfully, but these errors were encountered: