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-May/035838.html below:

[Python-Dev] RE: [Python-checkins] python/dist/src/Lib weakref.py,1.19,1.20

[Python-Dev] RE: [Python-checkins] python/dist/src/Lib weakref.py,1.19,1.20Tim Peters tim_one@email.msn.com
Sun, 25 May 2003 13:17:22 -0400
[Raymond Hettinger]
> Arghh.  One more example always arises after going to bed.
>
> The original required only equality.  The new version requires
> equality, hashability, *and* weak referencability.

It always required (and still does) all three for __setitem__ and
__getitem__:  key equality and hashability are required for all dicts, and
*of course* key weak referencability is required for a weak-keyed dict:
that's why it's called a weak-keyed dict <0.5 wink>.

__delitem__ alone used a bizarre algorithm, and indeed one that broke other
normal dict invariants such as that

    del d[k]

always deletes the same (key, value) pair that

    d[k] = v

would have replaced.




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