class A(int):
def __add__(self, value):
return int(str(self) + str(value))
class B(int):
pass
class C(int):
def __add__(self, value):
return int(bin(int(str(self)) + int(str(value)))[2:])
class D(int):
def __add__(self, value):
return f"{self}{value}"
for answer in (A, B, C, D):
x = y = answer(1)
print(f"{answer.__name__}: {x} + {y} = {x + y!r}")
A: 1 + 1 = 11
B: 1 + 1 = 2
C: 1 + 1 = 10
D: 1 + 1 = '11'