assignment_compatibility error

Assignment type incompatibility (literal mismatches)

Detects annotated module-level variables where the declared type and the literal kind of the right-hand side are clearly incompatible, for example:

count: int = "hello"   # str literal assigned to int annotation → E0014
label: str = 42        # int literal assigned to str annotation → E0014
flag:  bool = "yes"    # str literal assigned to bool annotation → E0014
ratio: float = "1.5"   # str literal assigned to float annotation → E0014

The check is performed by extracting the annotation text from the source around the variable's name span and comparing it against the RHS kind.

How to handle it

Every rule is on by default — strict is the default, not a cage. You can dial assignment_compatibility 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/assignment_compatibility