sparse assignment list in python
<p>I need a list with the following behavior</p>

<pre><code>&gt;&gt;&gt; l = SparseList()
&gt;&gt;&gt; l
[]
&gt;&gt;&gt; l[2] = "hello"
&gt;&gt;&gt; l
[ None, None, "hello"]
&gt;&gt;&gt; l[5]
None
&gt;&gt;&gt; l[4] = 22
&gt;&gt;&gt; l
[ None, None, "hello", None, 22]
&gt;&gt;&gt; len(l)
5
&gt;&gt;&gt; for i in l: print i
None
None
"hello"
None
22
</code></pre>

<p>Although it can "emulated" via a dictionary, it's not exactly the same. numpy array can behave this way, but I don't want to import the whole numpy for something like this. Before coding it myself, I ask if something similar exists in the standard library.</p>
