title: Multiple optional arguments python
body: <p>So I have a function with several optional arguments like so:</p>
  
  <pre><code>def func1(arg1, arg2, optarg1=None, optarg2=None, optarg3=None):
  </code></pre>
  
  <p>Optarg1 &amp; optarg2 are <em>usually</em> used together and if these 2 args are specified then optarg3 is not used.  By contrast, if optarg3 is specified then optarg1 &amp; optarg2 are not used.  If it were one optional argument it'd be easy for the function to "know" which argument to use: </p>
  
  <pre><code>if optarg1 != None:
      do something
  else:
      do something else 
  </code></pre>
  
  <p>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? </p>