3 ms·
How can you get both mutable and hashable instances at the same time?
by abhishekjha 7y ago
How can you get both mutable and hashable instances at the same time?
- detaro 7y agothe only requirement on a hashable instance is that it implements a proper __hash__ function. The default implementation in CPython returns the address of the memory the object is stored at, so all instances are considered unique, values play no role at all.