[issue6830] Some uniformness in defaultdict

2009-09-03 Thread Georg Brandl
Georg Brandl added the comment: This won't change -- the argument of defaultdict is simply a callable that is called with no arguments and returns the default value. It works with `int` because `int()` can be called without arguments and yields 0; however, `defaultdict` cannot. Therefore, the

[issue6830] Some uniformness in defaultdict

2009-09-03 Thread Toshihiro Kamiya
New submission from Toshihiro Kamiya : I found the syntax of collections.defaultdict is confusing, at least to me. When I need a defaultdict of int, that is, a defaultdict which contains int objects, I can write simply: a = defaultdict(int) However, when I want a defaultdict of defaultdict of