Message209714
Hi,
I am a bit unsure if this is a problem but bear with me:
Using ipaddress I noticed that:
hash(ipaddress.ip_address("0.0.0.1")) == hash(ipaddress.ip_address("::1"))
which makes sense as ipaddress uses this:
(http://hg.python.org/cpython/file/default/Lib/ipaddress.py)
def __hash__(self):
return hash(hex(int(self._ip)))
as the hash.
This means that in a mixed environment (ipv4 and ipv6 addresses), hashtables with hash(hex(int(b))), int(b)<2**32 will be filled more then tables with int(b)>2**32 due to the ipv4 and ipv6 address space overlapping in the first 32bits.
If this is intended behaviour, I am sorry to have bothered you.
Have a nice evening. |
|
Date |
User |
Action |
Args |
2014-01-30 13:02:08 | flambda | set | recipients:
+ flambda |
2014-01-30 13:02:08 | flambda | set | messageid: <1391086928.1.0.694997709579.issue20446@psf.upfronthosting.co.za> |
2014-01-30 13:02:08 | flambda | link | issue20446 messages |
2014-01-30 13:02:07 | flambda | create | |
|