title: defaultdict equivalent for lists
body: <p>Is there\How would you build an equivalent of python's very useful <a href="http://docs.python.org/library/collections.html#collections.defaultdict" rel="noreferrer"><code>collections.defaultdict</code></a>?</p>
  
  <p>Imagined usage of such a container:</p>
  
  <pre><code>&gt;&gt;&gt; a = collections.defaultlist(0)
  &gt;&gt;&gt; a[2]=7
  &gt;&gt;&gt; a[4]='x'
  &gt;&gt;&gt; a
  [0,0,7,0,'x']
  </code></pre>
  
  <p><strong>UPDATE:</strong> I've added a <a href="https://stackoverflow.com/questions/8749542/creating-a-defaultlist-for-python">follow up question</a> to add even more functionality to this construct</p>