[Python-ideas] An identity dict

Benjamin Peterson benjamin at python.org
Tue Jun 1 02:45:45 CEST 2010


Raymond Hettinger <raymond.hettinger at ...> writes:
> Also, there hasn't been much discussion of implementation,
> but unless you're willing to copy and paste most of the
> code in dictobject.c, you're going to end-up with something
> much slower than d[id(obj)]=value.

It can be implemented simply in Python:
http://codespeak.net/svn/pypy/trunk/pypy/lib/identity_dict.py







More information about the Python-ideas mailing list