Nick Coghlan wrote:

> I have a different suggestion: an identity dictionary.
>
> It ignores __hash__, __cmp__ and __eq__, and instead uses id() and is.

that's a rather common pattern, and you don't really need a special type
to handle it: just replace d[k] with d[id(k)].  if you really need to store the
keys in the dict, use d[id(k)] = k, v.

you can find some use of this pattern in Python's standard library.

</F> 



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to