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

Raymond Hettinger python@rcn.com
Sun, 25 May 2003 02:52:23 -0400


> As I said the first time <wink>,
> 
>     will succeed if and only if d.data has a key for a still-live object,
>     and that key compares equal to k1; else it will raise KeyError
>     (or maybe TypeError if k1 is a silly key to test in a weak-keyed dict,
>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     or MemoryError if we run out of memory).  That's what I believe it
>     should do.
> 
> I didn't add "and the hash codes are the same too" because that requirement
> is part of the the mapping protocol.

Okay, you've had a second review on the patch and backporting
to 2.2.3 is reasonable.  Please add a news item for the two changes
in behavior.

BTW, I wasn't trying to be difficult, I was starting from the presumption 
that Fred wasn't smoking dope when he put in that weird block of code.
Looks like the presumption was wrong ;-)


Raymond