#NEWLINE# def part_sum( x , i = 0 ) : #NEWLINE# #INDENT# 'All subsetsums from x[i:]\n\n    :param x: table of values\n    :param int i: index defining suffix of x to be considered\n    :iterates: over all values, in arbitrary order\n    :complexity: :math:`O(2^{len(x)-i})`\n    ' #NEWLINE# if ( i == len ( x ) ) : #NEWLINE# #INDENT# ( yield 0 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for s in part_sum ( x , ( i + 1 ) ) : #NEWLINE# #INDENT# ( yield s ) #NEWLINE# ( yield ( s + x [ i ] ) )