t411.py 925 B

123456789101112131415161718192021222324252627282930313233343536
  1. print "\nintegers"
  2. print hash(int()) == hash(int())
  3. print hash(332) == hash(332)
  4. print hash(-47) == hash(-47)
  5. print "\nlong integers"
  6. big = 123456789123456789123456789123456789123456789L
  7. print hash(long()) == hash(long())
  8. print hash(12L) == hash(12L)
  9. print hash(big) == hash(big)
  10. print hash(-big) == hash(-big)
  11. print "\nfloating points"
  12. print hash(float()) == hash(float())
  13. print hash(33.2) == hash(33.2)
  14. print hash(0.05) == hash(0.05)
  15. print hash(-11.85) == hash(-11.85)
  16. print "\nstrings"
  17. print hash('') == hash('')
  18. print hash("hello") == hash("hello")
  19. print "\ntuples"
  20. print hash(()) == hash(())
  21. print hash((1,2,3)) == hash((1,2,3,))
  22. print "\nintegers and floating point"
  23. print hash(1) == hash(1.0)
  24. print hash(1L) == hash(1)
  25. print hash(1.0) == hash(1L)
  26. print hash(1) == hash(1L) == hash(1.0)
  27. print hash(-5) == hash(-5L) == hash(-5.0)
  28. d = {1:2,3:4,-5.0:6}
  29. print d[1] == d[1.0] == d[1L]
  30. print d[-5] == d[-5.0] == d[-5L]