On Jul 7, 2005, at 8:45 PM, Neil Schemenauer wrote: > On Thu, Jul 07, 2005 at 12:38:38PM -0600, Neil Schemenauer wrote: >> Something like this would probably work (untested): >> >> def __cmp__(self, other): >> if self is other: >> return 0 >> return cmp(self, other) > > Oops, no. Don't do that. The ordering of btree keys *must* be > stable. You can't compare memory addresses or your btree will > become insane. Yep, you are right !! It does not return None anymore... but, it returns incorrect values! It seems it is returning the items from one BNode... repeatedly. Shall I consider hashing the keys myself? I am not sure what the implications are to my code... mario