durusmail: durus-users: snag with btree.get(key)
snag with btree.get(key)
2005-07-07
2005-07-07
2005-07-07
2005-07-08
2005-07-08
2005-07-08
2005-07-08
2005-07-08
2005-07-11
2005-07-08
2005-07-08
2005-07-08
2005-07-08
Schevo and moellus [was: Re: [Durus-users] snag with btree.get(key)]
2005-07-11
Re: Schevo and moellus [was: Re: [Durus-users] snag with btree.get(key)]
2005-07-13
2005-07-14
2005-07-14
2005-07-14
2005-07-13
2005-07-07
snag with btree.get(key)
Mario Ruggier
2005-07-07
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

reply