class Foo(): def __init(self,age): self.age = age def __add__(self,other): return Foo(self.age + other.age) obj1 = Foo(20) obj2 = Foo(21) obj3 = obj1+obj2