(sums)
return Add.make_args(added)
Helper function for _eval_expand_mul.

        sums must be a list of instances of Basic.
Helper function for _eval_expand_mul.
Helper function for _eval_expand_mul .
def _expandsums(sums):
        """
        Helper function for _eval_expand_mul.

        sums must be a list of instances of Basic.
        """

        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)
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 )