Home

Any reason why this wouldn't work?

>>> from collections import defaultdict
>>> def rdict(*args, **kw):
.... return defaultdict(rdict, *args, **kw)
....
>>> d = rdict()
>>> d[1][2][3][4][5] # ...
defaultdict(<function rdict at 0x61370>, {})


~ Daniel

previous
next

Re: Needless copying in iterations?
Re: Object instance creation error
Re: Help with Dictionaries and Classes requested please.
Re: C++ Feature Help
Re: So what exactly is a complex number?
Fundacja Avalon
Pajacyk
Mimo Wszystko
Niechciane i Zapomniane
Akogo