pylint-errors

E1140 (unhashable-dict-key)

:x: Problematic code:

numbers = [1, 2, 3]
data[numbers] = len(numbers)
print(data)

:heavy_check_mark: Correct code:

numbers = (1, 2, 3)
data[numbers] = len(numbers)
print(data)

Rationale:

Emitted when a dict key is not hashable (i.e. doesn’t define hash method).