Subclass using @dataclass(order=True)
have unavoidable "not using @override
" error for __lt__
etc, with --enable-error-code=explicit-override
#17224
Labels
bug
mypy got something wrong
good-second-issue
topic-dataclasses
topic-inheritance
Inheritance and incompatible overrides
Bug Report
If one has one dataclass
B
inherit from anotherA
and both are annotated withorder=True
, enabling theexplicit-override
error code gives errors attached to the subclassB
about missing@override
s on__lt__
(etc.) errors. They seem to be unavoidable: there's no method to attach@override
to.To Reproduce
Run this with
mypy --enable-error-code=explicit-override
:All-in-one reproducer:
Expected Behavior
Actual Behavior
Output:
Your Environment
--enable-error-code=explicit-overide
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: