BSK-E0031 error

Invalid cast() call

typing.cast(typ, val) must be called with exactly two positional arguments, and the first argument must be a type expression, not a value literal.

- cast() — too few arguments - cast(1, x) — first argument is a literal, not a type - cast(int, x, y) — too many arguments

Real basilisk check output

What you see when BSK-E0031 fires on a minimal example:

basilisk check output reporting BSK-E0031 — Invalid `cast()` call

How to handle it

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