
January 27th, 2013, 10:28 AM
|
|
Registered User
|
|
Join Date: Jan 2013
Posts: 1
Time spent in forums: 9 m 27 sec
Reputation Power: 0
|
|
|
__radd__() function
i have time class and two objects o1 and o2
with __radd__ funtion to overload +
def __radd__(self,other):
self.min+=other.min
when i call o1+o2, i expect o2.min to get incremented rather than o1 which is not the case
what i understand is that __radd__ is called when the object is on the right side of the operator, which in this case is o2
can anyone clear my doubt ?
thank you
|