Is there\How would you build an equivalent of python's very useful collections.defaultdict
?
Imagined usage of such a container:
>>> a = collections.defaultlist(0)
>>> a[2]=7
>>> a[4]='x'
>>> a
[0,0,7,0,'x']
UPDATE: I've added a follow up question to add even more functionality to this construct