literals_parameterizations error

Invalid Literal parameterization

PEP 586 restricts what values may appear inside Literal.... Only these are legal: - Integer literals (decimal, hex, binary, octal; optionally signed) - String literals (str and bytes) - Boolean literals (True, False) - None - Enum member access (Color.RED) - Nested Literal...

Everything else is illegal, including: - Arithmetic / unary expressions (3 + 4, ~5, not False) - Function calls ("foo".replace(...)) - Containers ((1, 2), {"a": "b"}) - Type objects, TypeVars, Any (Literalint, LiteralT) - Float literals (3.14) - Ellipsis (...) - Bare Literal with no arguments - Variables and function objects

How to handle it

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