(left, right)
return left.add(right)
Add two numbers or concatenate two strings.
Add two numbers or concatenate two strings.
Add two numbers or concatenate two strings .
def add(left, right):
    """Add two numbers or concatenate two strings."""
    if isinstance(left, numbers.Number):
        # promote Integer to Single to avoid integer overflow
        left = left.to_float()
    left, right = match_types(left, right)
    # note that we can't call iadd here, as it breaks with strings
    # since between copy and dereference the address may change due to garbage collection
    # it may be better to define non-in-place operators for everything
    return left.add(right)
def add ( left , right ) : if isinstance ( left , numbers . Number ) : # promote Integer to Single to avoid integer overflow left = left . to_float ( ) left , right = match_types ( left , right ) # note that we can't call iadd here, as it breaks with strings # since between copy and dereference the address may change due to garbage collection # it may be better to define non-in-place operators for everything return left . add ( right )