__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 ...
It has always seemed strange to me to use a mutable object for a hash key; hence Python has tuples and lists, and only tuples can be used as dictionary keys. I don't have any magical solutions to the problem you propose. However, it seems to me that making [1] == [1] is more...