I would rather stare on a single line for 20 seconds than try and figure out 7 lines of code with a for-loop, and if-else and a regular expression. ;-)
Maybe add a line of comment like:

```python
cpuset_list = cpuset.group(1).split(',')
# convert list of ranges (e.g. "2-4") to range size (e.g. 4 - 2 + 1 = 3), and sum
num_of_cpus = sum([(lambda x: x[-1] - x[0] + 1)(map(int, r.split('-'))) for r in cpuset_list])
```