GaryD - 2004-02-03

Logged In: YES
user_id=693152

I have also encountered this behaviour. I would classify it
as buggy (standard function does not behave as expected), or
at the very least unhelpful.

I've modified the __cmp__ function. Since I don't have the
option to upload a patch file, I'll just reproduce the
entire function below:

def __cmp__(self, other):
try:
xn, yn, p = _norm(self, other,
FixedPoint=type(self))
except TypeError:
# Could not convert other into a FixedPoint.
# Instead, we do a comparison with the number
# (in order to get consistent comparisons, as
# expected for this function)
return cmp(self.n, other)
return cmp(xn, yn)