t352.py 235 B

1234567891011121314151617
  1. class Silly:
  2. def __init__(self, x):
  3. self.h = x
  4. def __hash__(self):
  5. return 3
  6. def __str__(self):
  7. return str(self.h)
  8. a = Silly(1)
  9. b = Silly(2)
  10. c = Silly(3)
  11. print hash(a)
  12. print hash(b)
  13. print hash(c)