title: How can I tell if a python variable is a string or a list?
body: <p>I have a routine that takes a list of strings as a parameter, but I'd like to support passing in a single string and converting it to a list of one string. For example:</p>
  
  <pre><code>def func( files ):
      for f in files:
          doSomethingWithFile( f )
  
  func( ['file1','file2','file3'] )
  
  func( 'file1' ) # should be treated like ['file1']
  </code></pre>
  
  <p>How can my function tell whether a string or a list has been passed in? I know there is a <code>type</code> function, but is there a "more pythonic" way?</p>