def eval_sum_direct(expr, limits):
    from sympy.core import Add
    (i, a, b) = limits

    dif = a - b
    return Add(*[expr.subs(i, a + j) for j in range(dif + 1)])
dataset/ETHPy150Open sympy/sympy/sympy/concrete/summations.py/eval_sum_direct/swapped operands of `-`