title: How to use argparse arguments as function names
body: <p>I want to implement the example from the Argparse intro:</p>
  
  <pre><code>import argparse
  
  parser = argparse.ArgumentParser(description='Process some integers.')
  parser.add_argument('integers', metavar='N', type=int, nargs='+',
                     help='an integer for the accumulator')
  parser.add_argument('--sum', dest='accumulate', action='store_const',
                     const=sum, default=max,
                     help='sum the integers (default: find the max)')
  
  args = parser.parse_args()
  print(args.accumulate(args.integers))
  </code></pre>
  
  <p>But in my case, I'd like to have a wider range of possible function names to choose from. </p>
  
  <pre><code>def a(): ...
  def b(): ...
  def c(): ...
  
  parser.add_argument('-f', '--func', 
                       choices=[a, b, c], 
                       required=True,
                       help="""Choose one of the specified function to be run.""")
  parser.func()
  </code></pre>
  
  <p>Using it like that doesn't work as intended, I get</p>
  
  <pre><code>$ python program.py -f=a
  program.py: error: argument -f/--func: invalid choice: 'a' (choose from 
  &lt;function a at 0x7fa15f32f5f0&gt;, 
  &lt;function b at 0x7fa15f32faa0&gt;, 
  &lt;function c at 0x7ff1967099b0&gt;)
  </code></pre>
  
  <p>I know I could solve it with basic string arguments and flow control, but it would be a lot less cluttered and easier to maintain if I could use parser arguments directly as function names.</p>