1from collections import defaultdict
2d = defaultdict(dict)
3d['dict1']['innerkey'] = 'value'
4
5>>> d # currently a defaultdict type
6defaultdict(<type 'dict'>, {'dict1': {'innerkey': 'value'}})
7>>> dict(d) # but is exactly like a normal dictionary.
8{'dict1': {'innerkey': 'value'}}