Non-Enum
base class variables are interpreted as Enum
instances
#14600
Labels
bug
mypy got something wrong
Bug Report, Reproduction, & Actual Behaviour
An
enum.Enum
subclass allows a concrete data type and/or mix-in bases. However, if one of the non-Enum
bases contains variables or variable declarations (regardless of whether it is aClassVar
), mypy thinks that the variable is also anEnum
instance.Treating these variables as
Enum
instances will fail at runtime:Expected Behavior
mypy should act as if
E
did not haveEnum
as one of the base classes when accessing variables which are inherited fromA
:Your Environment
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: