自定义数据类型(类)

预定义特殊方法:

__lt__(self,other)      如果x<y返回true

__le__(self,other)     如果x<=y返回true

__eq__(self,other)    如果x==y返回true

__ne__(self,other)    如果x!=y返回true

__ge__(self,other)    如果x>=y返回true

__gt__(self,other)     如果x>y返回true

原文地址:https://www.cnblogs.com/revo/p/7153448.html