'Helper function for _eval_expand_mul.
sums must be a list of instances of Basic.'

@staticmethod
def _expandsums(sums):

    L = len(sums)
    if (L == 1):
        return sums[0].args
    terms = []
    left = Mul._expandsums(sums[:(L // 2)])
    right = Mul._expandsums(sums[(L // 2):])
    terms = [Mul(a, b) for a in left for b in right]
    added = Add(*terms)
    return Add.make_args(added)
