[Python-Dev] The memo of pickle
Wed, 7 Aug 2002 00:09:01 -0400
> The object's id() (address) is the key. Else only hashable objects
> could be pickled.
> Hmmm, I see.
> It occurs to me that what you really want here is a special
> kind of dictionary that uses "is" instead of "==" to compare
> key values.
Possibly. The *effect* of that could be gotten via a wrapper object, like
def __init__(self, obj):
self.obj = obj
def __eq__(self, other):
return self.obj is other.obj
but if Martin is worried about two-tuple sizes, he's not going to fall in
love with that.
> Or is that what was meant by an "identity dictionary"?
Guido asked, but if Martin answered that question I haven't seen it yet.