>>> 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:
 

2 Responses to Python WTF?

  1. Roman Kirillov says:

    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

  2. Holger Dürer says:

    So what is the WTF here? You were hoping for the hash value to be better mixed for similar numbers?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">