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.