A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-April/078433.html below:

[Python-Dev] __eq__ vs hash

[Python-Dev] __eq__ vs hash [Python-Dev] __eq__ vs hashGuido van Rossum guido at python.org
Fri Apr 4 18:08:16 CEST 2008
On Fri, Apr 4, 2008 at 8:08 AM, Jason Orendorff
<jason.orendorff at gmail.com> wrote:
> On Fri, Apr 4, 2008 at 9:38 AM, Guido van Rossum <guido at python.org> wrote:
>
> >  What specific code breaks? Maybe we need to turn this into a warning
>  >  in order to be more backwards compatible?
>
>  I looked at Mercurial.
>
>  It doesn't use __hash__ at all.  It uses __eq__ in two files, three total uses:
>  http://hg.intevation.org/mercurial/crew/file/6c4e12682fb9/mercurial/commands.py
>  http://hg.intevation.org/mercurial/crew/file/6c4e12682fb9/mercurial/context.py

If it breaks, perhaps the instances of one of those classes that
define __eq__ but not __hash__ are used in a set or as dict keys?
That's the difference between 2.5 and 2.6 in this area.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
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