class Sub1(object):
    number = 5

def __sub__(self, other):
    return NotImplemented


class Sub2(object):
    number = 2

def __rsub__(self, other):
    return other.number - self.number
a = Sub1()
b = Sub2()
print(a - b)
Using reverse operators in Python