title: Python: how to pass argument name using variable
body: <p>A module I'm using has many functions defined with different argument names more or less serving the same purpose:</p>
  
  <pre><code>def func1(start_date):
      ....
  def func2(startdate):
      ....
  def func3(s_date):
      ....
  def func4(sdate):
      ....
  </code></pre>
  
  <p>and they appear all in different positions of the argument list (in the above simplified case they're all in position 1, but in reality that's not the case).</p>
  
  <p>I want to write a wrapper that can pass the actual <code>start_date</code> to any of these functions via a dictionary from function name to argument name:</p>
  
  <pre><code>def func2arg_name():
      return {'func1' : 'start_date', 
              'func2' : 'startdate', 
              'func3' : 's_date', 
              'func4' : 'sdate' }
  </code></pre>
  
  <p>Then the actual wrapper:</p>
  
  <pre><code>f2a = func2arg_name()
  def func(func_name, sdate):
      locals()[func_name](f2a[func_name] = sdate)
  
  func('func1', '20170101')
  </code></pre>
  
  <p>Clearly this doesn't work. Essentially the f2a[func_name] is not being recognized as a legit keyword. Does any one know how to do this, i.e. pass the argument name using a variable? Note <code>func1</code> to <code>func4</code> are externally defined and cannot be changed.</p>