自定义数据类型(类)

预定义特殊方法:

__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

posted @ 2017-07-12 00:52  _revolution  阅读(241)  评论(0编辑  收藏  举报