False positive for overriding decorated method in an import cycle #5548
Labels
bug
mypy got something wrong
false-positive
mypy gave an error on correct code
priority-1-normal
topic-import-cycles
Consider this test:
It currently fails with
Although it is obviously compatible (it is actually identical). The error goes away if I change the order files are processed in the cycle (by importing
a
in main).The reason is that non-trivial decorator needs to be type-checked to find the type in superclass first. A potential solution is to just defer the subclass method node.
The text was updated successfully, but these errors were encountered: