python 运算符重载的问题
>>> class Dog:
... def __cmp__(self,other):
... if other > 0 : return 1;
... elif other < 0 : return -1;
... else: return 0
...
>>> dog = Dog()
>>> if dog > -10 : print "ok"
...
>>> if dog < -10 : print "ok"
...
ok
>>> if dog == 0 : print "ok"
...
ok
>>>