Hacker News new | past | comments | ask | show | jobs | submit login

Oops, messed this up (too late to edit). Thanks choochootrain for the correction:

  >>> NestedDD = lambda: collections.defaultdict(NestedDD)
  >>> nested_dd = NestedDD()
  >>> nested_dd['a']['b']['c']['d'] = 'hello'
does the proper thing.



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: