[issue20446] ipaddress: hash similarities for ipv4 and ipv6

2016-07-08 Thread Марк Коренберг
Марк Коренберг added the comment: See also issue20446 -- nosy: +mmarkk ___ Python tracker ___ ___

[issue20446] ipaddress: hash similarities for ipv4 and ipv6

2016-07-08 Thread Марк Коренберг
Марк Коренберг added the comment: Sorry. See also issue27269 -- ___ Python tracker ___ ___ Python-bugs-list

[issue20446] ipaddress: hash similarities for ipv4 and ipv6

2014-06-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: Correct me if I'm wrong, but wouldn't this only become a concern if: 1. You're storing both IPv4 and IPv6 addresses side-by-side 2. You're storing well over a billion IP addresses 3. Hash codes for the hex string of an IP address were predictably sequential

[issue20446] ipaddress: hash similarities for ipv4 and ipv6

2014-06-20 Thread Tim Peters
Tim Peters added the comment: I'm more puzzled by why `__hash__()` here bothers to call `hex()` at all. It's faster to hash the underlying int as-is, and collisions in this specific context would still be rare. @Josh, note that there's nothing bad about getting sequential hash codes in

[issue20446] ipaddress: hash similarities for ipv4 and ipv6

2014-06-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Tim Peters added the comment: I'm more puzzled by why `__hash__()` here bothers to call `hex()` at all. It's faster to hash the underlying int as-is, and collisions in this specific context would still be rare. Let someone provide a patch, then. --

[issue20446] ipaddress: hash similarities for ipv4 and ipv6

2014-06-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: @Tim: Sorry, forgot the internals there (I read all that a while ago, but it's not easy to keep all the details in mind). Apparently there are four reasons this isn't actually a problem. :-) I agree it's kind of silly that it's converted to a hex string

[issue20446] ipaddress: hash similarities for ipv4 and ipv6

2014-06-19 Thread Mark Lawrence
Mark Lawrence added the comment: Can someone comment on this issue please. -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20446 ___

[issue20446] ipaddress: hash similarities for ipv4 and ipv6

2014-06-19 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +ncoghlan, pmoody ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20446 ___ ___ Python-bugs-list mailing

[issue20446] ipaddress: hash similarities for ipv4 and ipv6

2014-06-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Unless you can show up a real-world workload where this truely impacts performance, I'd classify this is a rather vague concern. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org

[issue20446] ipaddress: hash similarities for ipv4 and ipv6

2014-01-30 Thread flambda
New submission from flambda: 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: