suggestion: recursive collections.defaultdict

tutufan at gmail.com tutufan at gmail.com
Mon Jun 18 12:41:58 EDT 2007


It seems like

    x = defaultdict(defaultdict(list))

should do the obvious, but it doesn't.  This seems to work

    y = defaultdict(lambda: defaultdict(list))

though is a bit uglier.




More information about the Python-list mailing list