Right-operand arithmetics

__radd__(self, b): This method defines b+self, while __add__(self, b) defines self+b. If a+b is encountered and a does not have an __add__ method, b.__radd__(a) is called if it exists (otherwise a+b is not defined).
Similar methods: __rsub__, __rmul__, __rdiv__

previousnexttable of contents