Straight-forward iterative solution:

```
def subsets(self, nums):
subsets = [[]]
for n in nums:
subsets += [s + [n] for s in subsets]
return subsets
```

Same thing but with `reduce`

instead of the loop:

```
def subsets(self, nums):
return reduce(lambda subsets, n: subsets + [s+[n] for s in subsets], nums, [[]])
```

Using `combinations`

from the library:

```
def subsets(self, nums):
return [s for n in range(len(nums)+1)
for s in itertools.combinations(nums, n)]
```

Using integers as bit mask to tell which elements to use in a subset:

```
def subsets(self, nums):
return [[nums[i] for i in range(len(nums)) if mask >> i & 1]
for mask in range(2 ** len(nums))]
```