Is it possible to pass arbitrary number of named default arguments to a Python function conditionally ?
For eg. there\'s a function:
def func(arg, ar
That wouldn't be valid Python syntax you have to have something after else. What is done normally is:
else
func('arg', 'arg2', 'some value' if condition else None)
and function definition is changed accordingly:
def func(arg, arg2='', arg3=None): arg3 = 'def' if arg3 is None else arg3