阅读背景:

为什么我不能像使用Python 2一样使用Python 3中的__cmp__方法呢?

来源:互联网 

The following piece of code

下面这段代码

class point:    def __init__(self, x, y):        self.x = x        self.y = y    def dispc(self):        return ('(' + str(self.x) + ',' + str(self.y) + ')')    def __cmp__(self, other):        return ((self.x > other.x) and (self.y > other.y))class po



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: