Python: "1-2-3-4" to [1, 2, 3, 4]
<p>What is the best way to convert a string on the format <code>"1-2-3-4"</code> to a list <code>[1, 2, 3, 4]</code>? The string may also be empty, in which case the conversion should return an empty list <code>[]</code>.</p>

<p>This is what I have:</p>

<pre><code>map(lambda x: int(x),
    filter(lambda x: x != '',
           "1-2-3-4".split('-')))
</code></pre>

<p>EDIT: Sorry all of those who answered before I corrected my question, it was unclear for the first minute or so.</p>
