
May 30, 2010
2:56 p.m.
On 05/31/10 00:23, Benjamin Peterson wrote:
Lie Ryan <lie.1296@...> writes:
what's wrong with dict[id(key)] = foo?
For one, you can't get the value of the key out of the dict.
mydict[id(key)] = (key, value)
that their id() is expensive is implementation details, and the developer of PyPy should solve that instead of adding a clutch to the stdlib.
A "clutch"? Even ignoring PyPy, an identitydict is still a useful primitive.
it may be useful, but if you can emulate it relatively easily with regular dict, why bother with a new type?