BSK-E0096
error
Type mismatch between a dataclass field(default_factory=…) and the field's declared type annotation
When a dataclass field uses field(default_factory=T) where T is a known callable that constructs instances of a simple built-in type, but the field's annotation declares a different incompatible built-in type, Basilisk reports an error.
from dataclasses import dataclass, field
@dataclass
class DC:
a: int = field(default_factory=str) # E: str() → str, not int
How to handle it
Every rule is on by default — strict is the default, not a cage. You can dial
BSK-E0096 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-E0096