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/2003-December/041378.html below:

[Python-Dev] getting rid of default object.__hash__ (SF 660098)

[Python-Dev] getting rid of default object.__hash__ (SF 660098) [Python-Dev] getting rid of default object.__hash__ (SF 660098)Guido van Rossum guido at python.org
Mon Dec 22 16:29:23 EST 2003
> Would this mean that instances of the following class:
> 
> class Dummy(object):
>      pass
> 
> would no longer be usable as dictionary keys?  I guess the parts I'm
> not clear on are 1) whether dictionaries call the equivalent of
> 'hash(key)' or 'key.__hash__()', and 2) whether 'hash(Dummy())' will
> do something meaningful.

That class would still be usable.  hash(Dummy()) sees that there's no
__eq__ or __cmp__ override and then uses the default hash.

--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