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-08
On Jul 8, 2005, at 10:56 AM, Mario Ruggier wrote:

>     def __cmp__(self, other):
>         if self is other:
>             return 0
>         return cmp(self._id, other._id)

I've had to change this a little ... ;-)

     def __cmp__(self, other):
         if self is other:
             return 0
         try:
             return cmp(self._id, other._id)
         except:
             return cmp(self._id, other)


for when other does not have _id attribute.
Is this a good handling for this?

btw, this method is on the PersistentItem class...

mario

reply