Does Python come with a function to split a list using a delimiter?
<p>Having a <code>list</code> that contains <code>string</code>s, I want to split the <code>list</code> at each point where it contains the empty <code>string</code> (<code>''</code>), e.g. </p>

<pre><code>['this', 'is', '', 'an', 'example']
</code></pre>

<p>should become</p>

<pre><code>[['this', 'is'], ['an', 'example']]
</code></pre>

<p>I wrote a generator that does this:</p>

<pre><code>def split(it, delimiter):
    it = iter(it)
    buffer = []
    while True:
        element = next(it)
        if element != delimiter:
            buffer.append(element)
        elif buffer:
            yield buffer
            buffer = []
</code></pre>

<p>Since this looks pretty general, I was wondering if I missed some similar function or related pattern in <code>itertools</code> or somewhere else...?</p>
