So I\'m writing a class that extends a dictionary which right now uses a method \"dictify\" to transform itself into a dict. What I would like to do instead though is change it
Once you have your dictify function working just do
dict = dictify
Update: Here is a short way to have this recursive dict:
>>> def RecursiveDict():
... return defaultdict(RecursiveDict)
Then you can:
d[1][2][3] = 5
d[1][2][4] = 6
>>> d
defaultdict(, {1: defaultdict(, {2: defaultdict(, {3: 5, 4: 6})})})
I don't see a neat way to implement dictify.