In 45 timeit line rsplit 1000000 loops best of 530 ns per loop In 46 t

1
2
3
4
5
In [45]: %timeit line[0].rsplit('-',1)
1000000 loops, best of 3: 530 ns per loop
In [46]: %timeit 'line[0][0:line[0].rfind("-")], line[0][line[0].rfind("-")+1:]'
10000000 loops, best of 3: 25.9 ns per loop