Only concrete class can be decorated with @total_ordering #8539
Labels
bug
mypy got something wrong
false-positive
mypy gave an error on correct code
priority-1-normal
topic-runtime-semantics
mypy doesn't model runtime semantics correctly
When I check this code with mypy:
It reports:
I'm using mypy 0.770 under Python 3.7.3 on openSUSE Linux.
I don't see a reason why an abstract class cannot be decorated with
@total_ordering
.In typeshed commit e404e15 the signature of
total_ordering
was changed to preserve the original type. I think that change makes sense until fulltotal_ordering
support is implemented (#4610), but it does trigger the issue described above.I think this issue may be a variation of #5374, since that describes a similar problem when using
@dataclass
as an annotation.The text was updated successfully, but these errors were encountered: