You can also use the `subsets` function from sympy.utilities.iterables, though it's basically just a wrapper around this same thing.