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/2001-January/011835.html below:

[Python-Dev] Weird use of hash() -- will this work?

[Python-Dev] Weird use of hash() -- will this work? [Python-Dev] Weird use of hash() -- will this work?Tim Peters tim.one@home.com
Thu, 18 Jan 2001 17:58:22 -0500
[Tim whined]
> BTW, why doesn't hash([]) blow up in 2.1a1?  In 2.0 it raised
>
>     TypeError: unhashable type
>
> Did someone change this deliberately?

Answer:  it's an unintended consequence of the rich-comparison changes.
Guido knows how to fix it and probably <wink> will.  The list type grew a
tp_richcompare slot but lost its non-NULL tp_compare pointer.  PyObject_Hash
wasn't changed accordingly (it now believes lists support neither direct
hashing nor comparison, so does them a favor and hashes their memory
addresses).  Something trickier is probably going wrong elsewhere too, but I
won't try to remember what that is unless Guido gets hit by a bus tonight.

in-which-case-we-can-push-off-the-funeral-until-after-the-release-ly
    y'rs  - tim




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