It seems to me that you are doing redundand work, and the simplest hasb solution is left as it is. Those a, b, care keyword arguments, as well as positional, so you can call your function the way you like:
>>> def f(a, b, c=3):
... print a, b, c
With all keywords args
>>> f(**{'a':1, 'b':2})
1 2 3
With a combination of positional and keywords args
>>> f(5, **{'b':4})
5 4 3
And get the correct error in case of incorrect args keywords
>>> f(**{'d':4, 'a':1, 'b':2})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: f() got an unexpected keyword argument 'd'
source
share