So I have a function with several optional arguments like so:
def func1(arg1, arg2, optarg1=None, optarg2=None, optarg3=None):
Optarg1 & optarg2 are usually used together and if these 2 args are specified then optarg3 is not used. By contrast, if optarg3 is specified then optarg1 & optarg2 are not used. If it were one optional argument it'd be easy for the function to "know" which argument to use:
if optarg1 != None:
do something
else:
do something else
My question is how to I "tell" the function which optional argument to use when there's multiple optional arguments and not all of them are always specified? Is parsing the arguments with **kwargs the way to go?