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)
David Binger
2005-07-08
On Jul 8, 2005, at 5:15 AM, Mario Ruggier wrote:
>
> 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?

If the other is an instance of Persistent with no _id
attribute, I think this should really raise an exception.

I think you should specify "except AttributeError"
in cases like this.

reply