better cmp operator for mismatched classes

This commit is contained in:
Joe Shochet 2004-07-26 21:44:49 +00:00
parent b1377f317e
commit d855d6c85a
1 changed files with 2 additions and 1 deletions

View File

@ -183,8 +183,9 @@ class FFIExternalObject:
if isinstance(other, self.__class__):
return self.compareTo(other)
# Otherwise, they must not be the same
# Just do a basic python id compare
else:
return 1
return cmp(id(self), id(other))
def __repr__(self):
# Lots of Panda classes have an output function defined that takes an Ostream