title: Python argparse: type conversion of a list of default arguments
body: <p>I'm writing a tool with argparse that'll take a list of source directories from the command line and process all the files in them. Ultimately, when parse_args is called, each directory is scanned for files to process, and the list of files is put into the <code>files</code> attribute off the returned namespace.</p>
  
  <pre><code>parser = argparse.ArgumentParser()
  parser.add_argument('-s', '--sources'
      , dest = 'files'
      , default = 'results/e1653a3'
      , nargs = '*'
      , metavar = 'SOURCE'
      , action = ConcatAction
      , type = FileList
  )
  args = parser.parse_args()
  </code></pre>
  
  <p>Here, the <code>FileList</code> function takes a directory name and returns a list of files. <code>ConcatAction</code> is an action which flattens a list of lists. The result is that I can call my tool like <code>tool.py -s dir1 dir2</code>, and <code>args.files</code> contains all the files in both directories.</p>
  
  <p>By default, I want it to scan multiple directories; however, passing a list to the defaults:</p>
  
  <pre><code>, default = ['dir1', 'dir2']
  </code></pre>
  
  <p>Sidesteps the type conversion system of argparse, so <code>FileList()</code> is never called, and <code>args.files</code> contains the list <code>['dir1', 'dir2']</code>, and not the scanned files. If I try</p>
  
  <pre><code>, default = 'dir1 dir2'
  </code></pre>
  
  <p>Then a single call to <code>FileList('dir1 dir2')</code> is made instead of the two calls <code>FileList('dir1')</code> <code>FileList('dir2')</code></p>
  
  <p>I know I can just process the source directories outside of argparse to get the functionality I want, but is there anyway to get argparse to perform type conversion on a list of default values?</p>