How about:

```python
cpuset_list = cpuset.group(1).split(',')
num_of_cpus = sum([(lambda x: x[-1] - x[0] + 1)(map(int, r.split('-'))) for r in cpuset_list])
```

It's not going to win any beauty contests, but it works:

```
>>> cpuset_list = ['1']
>>> sum([(lambda x: x[-1] - x[0] + 1)(map(int, r.split('-'))) for r in cpuset_list])
1
>>> cpuset_list = ['1', '2-3']
>>> sum([(lambda x: x[-1] - x[0] + 1)(map(int, r.split('-'))) for r in cpuset_list])
3
>>> cpuset_list = ['1', '2-3', '5-8', '10']
>>> sum([(lambda x: x[-1] - x[0] + 1)(map(int, r.split('-'))) for r in cpuset_list])
8
```