def parse_sequence(text):
    for chunk in text.split(','):
        parts = map(int, chunk.split('-'))
if len(parts) == 1:
    yield parts[0]
else:
    for n in range(parts[0], parts[1] + 1):
        pass
breaking a complex string ('2,3-5,50-60,70') into list inplace