AI engineering glossary · Python core
What is hashable?
Hashable: Describes an object with a hash value that never changes during its lifetime and that can be compared for equality. Only hashable objects can be dictionary keys or set members. Immutable built-ins are hashable; lists, dicts and sets are not.
Hashable: an example
hash('abc') works and {(1, 2): 'ok'} is valid, but {[1, 2]: 'x'} raises TypeError: unhashable type: 'list'.
Related terms
More Python core terms
Where you learn it
Hashable is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.