class Rmaxplus:
def __init__(self, x):
self.x=x
def __add__(self,other):
return Rmaxplus(max(self.x, other.x))
Что не так??
Python 2.7.9
class Rmaxplus:
def __init__(self, x):
self.x=x
def __add__(self,other):
return Rmaxplus(max(self.x, other.x))
def __radd__(self,other):
return Rmaxplus(max(self.x, other.x))
def __add__(other, self):
return Rmaxplus(max(self.x, other.x))
def __radd__(other, self):
return Rmaxplus(max(self.x, other.x))