Re: suggestion: recursive collections.defaultdict

2007-06-28 Thread [EMAIL PROTECTED]
On Jun 18, 1:56 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, > > [EMAIL PROTECTED] wrote: > > It seems like > > > x = defaultdict(defaultdict(list)) > > > should do the obvious, but it doesn't. > > It *does* the obvious. Parenthesis after a name means: call

Re: suggestion: recursive collections.defaultdict

2007-06-18 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > It seems like > > x = defaultdict(defaultdict(list)) > > should do the obvious, but it doesn't. It *does* the obvious. Parenthesis after a name means: call this object *now*. Any other behavior wouldn't be obvious. Ciao, Marc 'Bl

suggestion: recursive collections.defaultdict

2007-06-18 Thread [EMAIL PROTECTED]
It seems like x = defaultdict(defaultdict(list)) should do the obvious, but it doesn't. This seems to work y = defaultdict(lambda: defaultdict(list)) though is a bit uglier. -- http://mail.python.org/mailman/listinfo/python-list