title: Python argparse custom actions with additional arguments passed
body: <pre><code>import argparse
  
  class customAction(argparse.Action):
      def __call__(self, parser, args, values, option_string=None):
         setattr(args, self.dest, values)
  
  parser = argparse.ArgumentParser()
  parser.add_argument('-e', '--example', action=customAction)
  </code></pre>
  
  <p>I want to pass additional arguments to customAction when the option -e is triggered, e.g. a instance of another class. How can I do this? Everything I have tried has errored out.</p>