'Returns self + other.
-INF + INF (or the reverse) cause InvalidOperation errors.'

def __add__(self, other, context=None):

    other = _convert_other(other)
    if (context is None):
        context = getcontext()
    if (self._is_special or other._is_special):
        ans = self._check_nans(other, context)
        if ans:
            return ans
        if self._isinfinity():
            if ((self._sign != other._sign) and other._isinfinity()):
                return context._raise_error(InvalidOperation, '-INF    +    INF')
            return Decimal(self)
        if other._isinfinity():
            return Decimal(other)
    shouldround = (context._rounding_decision == ALWAYS_ROUND)
    exp = min(self._exp, other._exp)
    negativezero = 0
    if ((context.rounding == ROUND_FLOOR) and (self._sign != other._sign)):
        negativezero = 1
    if ((not self) and (not other)):
        sign = min(self._sign, other._sign)
        if negativezero:
            sign = 1
        return Decimal((sign, (0,), exp))
    if (not self):
        exp = max(exp, ((other._exp - context.prec) - 1))
        ans = other._rescale(exp, watchexp=0, context=context)
        if shouldround:
            ans = ans._fix(context)
        return ans
    if (not other):
        exp = max(exp, ((self._exp - context.prec) - 1))
        ans = self._rescale(exp, watchexp=0, context=context)
        if shouldround:
            ans = ans._fix(context)
        return ans
    op1 = _WorkRep(self)
    op2 = _WorkRep(other)
    (op1, op2) = _normalize(op1, op2, shouldround, context.prec)
    result = _WorkRep()
    if (op1.sign != op2.sign):
        if (op1.int == op2.int):
            if (exp < context.Etiny()):
                exp = context.Etiny()
                context._raise_error(Clamped)
            return Decimal((negativezero, (0,), exp))
        if (op1.int < op2.int):
            (op1, op2) = (op2, op1)
        if (op1.sign == 1):
            result.sign = 1
            (op1.sign, op2.sign) = (op2.sign, op1.sign)
        else:
            result.sign = 0
    elif (op1.sign == 1):
        result.sign = 1
        (op1.sign, op2.sign) = (0, 0)
    else:
        result.sign = 0
    if (op2.sign == 0):
        result.int = (op1.int + op2.int)
    else:
        result.int = (op1.int - op2.int)
    result.exp = op1.exp
    ans = Decimal(result)
    if shouldround:
        ans = ans._fix(context)
    return ans
