On Thu, Jul 07, 2005 at 12:24:06PM -0600, Neil Schemenauer wrote: > You might be getting bitten by the fact that btree keys are > compared, not hashed. I thought about this a little more and I believe this is the problem. I was initially confused as to why you could get away with a __hash__ on objects and still use them as keys in a PersistentDict. The reason is that although the default __hash__ returns the object's memory address, that works for PersistentDict because the objects are all loaded at once into the table when the object is unghosted. That's not the case for btrees (the default __cmp__ also uses the memory address). Something like this would probably work (untested): def __cmp__(self, other): if self is other: return 0 return cmp(self, other)