Advertisement
michaelmior

hash() on objects

Apr 10th, 2012
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.14 KB | None | 0 0
  1. class Foo(object):
  2.     def __init__(self, x):
  3.         self.x = x
  4.  
  5. # These two values are the same
  6. print(hash(Foo(3)))
  7. print(hash(Foo(4)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement