Hello,<br><br>I need to have a dictionary of dictionaries of numbers, and I would like the dictionaries to be defaultdicts, because it makes the code much nicer<br>(I want to be able to do:  d['foo']['bar']+=1 ). 
<br><br>So naturally, I used:<br><br>d = defaultdict(lambda :defaultdict(int))<br><br>It works great, but now I can not pickle it.<br><br>I could ofcourse used a real function and not a lambda, but this would make things (a) somewhat slower and (b) a bit ugly.
<br><br>Is there another way of achieving the same behaviour, that allow for pickling?<br><br><br>Thanks,<br>Yoav<br><br><br><br>