Python __rsub__() Magic Method
Syntax object.__rsub__(self, other) The Python __rsub__() method implements the reverse subtraction operation that is subtraction with reflected, swapped operands. So, when you call x – y, Python attempts to call x.__sub__(y). Only if the method is not implemented on the left operand, Python attempts to call __rsub__ on the right operand and if this isn’t … Read more