Created
July 23, 2014 15:20
-
-
Save rsyring/539797e18eada076bab1 to your computer and use it in GitHub Desktop.
autokeyed python dictionary using defaultdict
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 autokeyed_dict(): | |
return defaultdict(autokeyed_dict) | |
mydict = autokeyed_dict() | |
mydict['properties']['recent_conversion_event_name']['value'] = 'Test Drive Form' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
attribution: http://stackoverflow.com/questions/13151276/automatically-add-key-to-python-dict