A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2009-September/092224.html below:

[Python-Dev] PEP 3144 review.

[Python-Dev] PEP 3144 review. [Python-Dev] PEP 3144 review.Antoine Pitrou solipsis at pitrou.net
Mon Sep 28 16:57:14 CEST 2009
Dj Gilcrease <digitalxero <at> gmail.com> writes:
> 
> >>> net1 = IPNetwork("10.1.2.3/24")
> >>> net2 = IPNetwork("10.1.2.0/24")
> >>> print hash(net1) == hash(net2)
> False
> >>> print net1 == net2
> True

Ouch :-)
It is very bad practice for equal objects to hash differently. Differing hashes
are supposed to imply non-equal objects, so as to allow the implementation of
associative containers with good performance characteristics.

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4