Created
March 23, 2011 23:16
-
-
Save mkelley33/884240 to your computer and use it in GitHub Desktop.
create a defaultdict whose values are also defaultdicts, nested arbitrarily deep
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: | |
http://personalpages.tds.net/~kent37/kk/00013.html | |
class recursivedefaultdict(defaultdict): | |
def __init__(self): | |
self.default_factory = type(self) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment