sigizmund.com
>>> for i in range (0, 10):
… hash(i)
…
0
1
2
3
4
5
6
7
8
9
>>> hash(123324)
123324
>>> hash(785345345436845768)
785345345436845768
>>>
WTF?
Tagged with: geek
2 Responses to Python WTF?
Leave a Reply Cancel reply
-
Categories
-
Calendar
May 2012 M T W T F S S « Feb 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 -
Meta





OK, it's not that bad really:>>> hash(1)1>>> hash('abc')1453079729188098211>>> hash('bcd')327024216812240872>>> hash('hello')840651671246116861>>> hash('world')-4197332404363456935>>> hash(34243242344235346456756345345)2368174836462727840>>> hash(3424324234423534645675)-6770163286441954716
So what is the WTF here? You were hoping for the hash value to be better mixed for similar numbers?