enums_behaviors error

Invalid Enum subclassing

An Enum class with one or more defined members is implicitly final and cannot be subclassed. Only Enum subclasses with no members can be used as bases for other Enum classes.

class Color(Enum):
    RED = 1
    GREEN = 2

class ExtendedColor(Color):  # E — Color has members and is implicitly final
    BLUE = 3

How to handle it

Every rule is on by default — strict is the default, not a cage. You can dial enums_behaviors down per-file or per-path from your editor or pyproject.toml, or fix the code so it type-checks. See the Type System rules and the complete diagnostic reference.

Canonical URL: https://www.basilisk-python.dev/errors/enums_behaviors