match_exhaustiveness
error
Non-exhaustive match statement
A value-dispatch match statement that has no irrefutable branch may fail to handle certain runtime values, leading to a silent fall-through (Python does not raise an error for unmatched match subjects). Basilisk reports this as an error.
Two cases are not flagged, matching the reference checkers: a bare capture case name: (no guard) is irrefutable — like case _:, it makes the match exhaustive; a structural match (sequence/mapping patterns) decomposes open-ended shapes — e.g. narrowing a tuple union of mixed arity — where a catch-all is not required for correctness.
How to handle it
Every rule is on by default — strict is the default, not a cage. You can dial
match_exhaustiveness 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/match_exhaustiveness