aliases_type_statement error

Invalid RHS in a PEP 695 type X = rhs statement

PEP 695 requires the RHS of a type statement to be a valid type expression. The same restrictions as TypeAlias (aliases_implicit) apply.

type BadAlias1 = [int, str]   # E — list literal
type BadAlias2 = True         # E — bool literal
type BadAlias3 = 1            # E — int literal

How to handle it

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