Pythonic way to always get a list
<p>Is there a standard library function or more pythonic way to do this ?</p>

<pre><code>def itemize(i):
    if type(i) is list:
        return i
    return [i]
</code></pre>

<p>Context:</p>

<p>Useful in db (nosql style) migrations from single value to a list</p>

<pre><code>doc = &lt;get doc from db&gt;
for i in itemize(doc.var1):
    #blah
</code></pre>

<p>or</p>

<pre><code>doc.var1 = itemize(doc.var1)
</code></pre>
