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

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

    other = _convert_other(other)
    if (other is NotImplemented):
        return other
    else:
        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)
        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
            ans = _dec_from_triple(sign, '0', exp)
            ans = ans._fix(context)
            return ans
        if (not self):
            exp = max(exp, ((other._exp - context.prec) - 1))
            ans = other._rescale(exp, context.rounding)
            ans = ans._fix(context)
            return ans
        if (not other):
            exp = max(exp, ((self._exp - context.prec) - 1))
            ans = self._rescale(exp, context.rounding)
            ans = ans._fix(context)
            return ans
        op1 = _WorkRep(self)
        op2 = _WorkRep(other)
        (op1, op2) = _normalize(op1, op2, context.prec)
        result = _WorkRep()
        if (op1.sign != op2.sign):
            if (op1.int == op2.int):
                ans = _dec_from_triple(negativezero, '0', exp)
                ans = ans._fix(context)
                return ans
            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)
        ans = ans._fix(context)
        return ans
