SHARE
TWEET

hash() on objects

michaelmior Apr 10th, 2012 33 Never
  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)))
RAW Paste Data
Top