BSK-E0040
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
Real basilisk check output
What you see when BSK-E0040 fires on a minimal example:
How to handle it
Every rule is on by default — strict is the default, not a cage. You can dial
BSK-E0040 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/BSK-E0040