If I have class A that defines __cmp__
, and class B that extends class A, it seems like I have to redefine __cmp__
in class B. Is this correct?
Is there a better workaround than implementing a method "cmp" in class A and calling it from the separate implementations of __cmp__
in class A and class B?
Thanks, -aj
UPDATE: The issue seems to be my lack of Python 3 exposure. As I read it, __cmp__
should no longer be used: http://docs.python.org/dev/3.0/whatsnew/3.0.html#ordering-comparisons
Instead, I've re-implemented my classes using the new ordering comparison operators: http://docs.python.org/dev/3.0/reference/datamodel.html#object.%5F%5Flt%5F%5F