title: How to collapse consecutive delimiters?
body: <p>The default <code>split</code> method in Python treats consecutive spaces as a single delimiter.  But if you specify a delimiter string, consecutive delimiters are <em>not</em> collapsed:</p>
  
  <pre><code>&gt;&gt;&gt; 'aaa'.split('a')
  ['', '', '', '']
  </code></pre>
  
  <p>What is the most straightforward way to collapse consecutive delimiters?  I know I could just remove empty strings from the result list:</p>
  
  <pre><code>&gt;&gt;&gt; result = 'aaa'.split('a')
  &gt;&gt;&gt; result
  ['', '', '', '']
  &gt;&gt;&gt; result = [item for item in result if item]
  </code></pre>
  
  <p>But is there a more convenient way?</p>