yield (sum(...)) in this line you're just yielding a single item, the flattened list of all combinations.

For Python 2.X sum([(map(list, combinations(arr, i))) ...]) will work, but in Python 3.X map no longer returns a list. Instead it returns a map object. So, if anyones on Python 3.X simply turn this into list(map(.....)) for this to run on 3.X.