I know that maybe the title of the question is not the most intuitive one, but I could not think of better way to describe it in short and here is what I actually mean.
I want to write some small parser, that would build a dictionary of kwargs out of string that I specify.
Here is an example:
string_of_kwargs = 'n=6,m=10'
graph_kwargs = {pair.split('=')[0]:pair.split('=')[1]
for pair in string_of_kwargs.split(',')}
And the output is:
{'n': '6', 'm': '10'}
The problem is that in the code above I had to use pair.split('=') twice and I wonder if there is some way to go around it in case I had to unpack more values like this in future.