您需要实现该
__radd__方法:
class T: def __init__(self,x): self.x = x def __radd__(self, other): return other + self.xtest = (T(1),T(2),T(3),200)print sum(test)
欢迎分享,转载请注明来源:内存溢出
您需要实现该
__radd__方法:
class T: def __init__(self,x): self.x = x def __radd__(self, other): return other + self.xtest = (T(1),T(2),T(3),200)print sum(test)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)