arg.split()
does not split the list the way you want because the default separator does not match yours:
In [3]: arg
Out[3]: 'egg1, egg2'
In [4]: arg.split()
Out[4]: ['egg1,', 'egg2']
In [5]: arg.split(', ')
Out[5]: ['egg1', 'egg2']
From the docs (emphasis added):
If sep is not specified or is None
, a different splitting algorithm is applied: runs of consecutive whitespace are regarded as a single separator, and the result will contain no empty strings at the start or end if the string has leading or trailing whitespace.