dict_key_hashable
error
Unhashable type used as a dict key
Lists, sets, and plain dicts are not hashable and cannot be used as dictionary keys at runtime. Basilisk detects these statically.
def bad_key() -> None:
mapping = {[1, 2]: "value"} # list as key → E0022
How to handle it
Every rule is on by default — strict is the default, not a cage. You can dial
dict_key_hashable 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/dict_key_hashable