
June 2, 2010
7:42 p.m.
Raymond Hettinger <raymond.hettinger@...> 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.
A slightly hacky way to implement this on CPython without copying much would be to implement __getitem__, and __setitem__ in C and subclass it in Python to call those methods in the rest of dictionary implementation.