class A(object):

    def __init__(self, value):
        self.value = value

def __repr__(self):
    return value

def __add__(self, other):
    return A(self.value + other.value)
Implicit conversions in Python