next_val = input_list[0]
for rest in combinations(input_list[1:], acc):
    yield rest
acc += next_val
for rest in combinations(input_list[1:], acc):
    yield rest
What's the most memory efficient way to generate the combinations of a set in python?