Straight-forward iterative solution:

```
def subsets(self, nums):
subsets = [[]]
for n in sorted(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],
sorted(nums), [[]])
```

Using `combinations`

from the library:

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

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

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