Created
December 7, 2014 02:31
-
-
Save lextoumbourou/bba467e3e52284d8e7a2 to your computer and use it in GitHub Desktop.
Super simple auto nested dict in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
def auto_nested_dict(): | |
return defaultdict(auto_nested_dict) | |
if __name __ == '__main__': | |
d = auto_nested_dict() | |
d['wats']['up']['world'] = 'Here I am!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment