I have a python function (python 2.5) with a definition like:
def Foo(a, b='Silly', c='Walks', d='Spam', e='Eggs', f='Ni', *addl):
Where addl
can be any number of strings (filenames) to do something with.
I'm fine with all of the defaults, but I have filenames to put in addl
.
I am inclined to do something like:
Foo('me@domain.com', addl=('File1.txt', 'File2.txt'))
But that gets the following error:
TypeError: Foo() got an unexpected keyword argument 'addl'
Is there a syntax where I can succinctly call Foo
with just the first required parameter and my (variable number of) additional strings? Or am I stuck redundantly specifying all of the defaults before I can break into the addl
argument range?
For the sake of argument, the function definition is not able to be modified or refactored.