To understand hashable objects in Python, it is important to review what a hash table is. Followingthe article on Wikipedia, a hash table is a data structure that can map keys to values and that implements a hash function to compute the index to an array of buckets or slots. Heavy words...
__eq__(other) # any non-hashable instance of a non-hashable class # ┌────────┴────────┐ isinstance(UnhashableClass(), Hashable)Traceback for (cpython) Python 3.13.1:Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main ...
If you see all Sets as equal if they have the same elements, that's one equality. If you care to distinguish between different kinds of sets (e.g., an OrderedSet and a HashSet, or a modifiable Set and an UnmodifiableSet, or any two sets which would iterate the elements in different ...