title: Python: Split a string, respect and preserve quotes
body: <p>Using python, I want to split the following string:</p>
  
  <pre><code>a=foo, b=bar, c="foo, bar", d=false, e="false"
  </code></pre>
  
  <p>This should result in the following list:</p>
  
  <pre><code>['a=foo', 'b=bar', 'c="foo, bar"', 'd=false', 'e="false'"']
  </code></pre>
  
  <p>When using shlex in posix-mode and splitting with ", ", the argument for <code>c</code>gets treated correctly. However, it removes the quotes. I need them because <code>false</code> is not the same as <code>"false"</code>, for instance.</p>
  
  <p>My code so far:</p>
  
  <pre><code>import shlex
  
  mystring = 'a=foo, b=bar, c="foo, bar", d=false, e="false"'
  
  splitter = shlex.shlex(mystring, posix=True)
  splitter.whitespace += ','
  splitter.whitespace_split = True
  print list(splitter) # ['a=foo', 'b=bar', 'c=foo, bar', 'd=false', 'e=false']
  </code></pre>