Enums: false-positive "No base classes allowed after ReprEnum
" error
#12787
Labels
bug
mypy got something wrong
false-positive
mypy gave an error on correct code
topic-enum
topic-inheritance
Inheritance and incompatible overrides
Bug Report
Minimal repro on 3.11 (playground link):
Minimal repro on <=3.10 (playground link):
mypy output for both (with small line-number differences):
Expected Behavior
No error should be reported. This use of multiple inheritance works fine at runtime on 3.10 and 3.11. In fact, in 3.11, the source code for the
enum
module in the stdlib uses exactly this inheritance structure:Your Environment
I can reproduce this bug on mypy 0.940+ (0.940 was the first released version with @sobolevn's #12026, which introduced this error message).
The text was updated successfully, but these errors were encountered: