Yesterday my exercise got downvoted, probably because its point was unclear. I'd like to try again with this reworked exercise. Hope you'll like this one better.
- Solution
- Explanation: “User-defined classes have
__eq__()and__hash__()methods by default (inherited from the object class); with them, all objects compare unequal (except with themselves) andx.__hash__()returns an appropriate value such thatx == yimplies both thatx is yandhash(x) == hash(y).”
#Python #memory_graph #Equality #Hashing

0 Comments
No comments yet.