This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author flambda
Recipients flambda
Date 2014-01-30.13:02:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391086928.1.0.694997709579.issue20446@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-01-30 13:02:08flambdasetrecipients: + flambda
2014-01-30 13:02:08flambdasetmessageid: <1391086928.1.0.694997709579.issue20446@psf.upfronthosting.co.za>
2014-01-30 13:02:08flambdalinkissue20446 messages
2014-01-30 13:02:07flambdacreate