[issue6830] Some uniformness in defaultdict

Georg Brandl report at bugs.python.org
Thu Sep 3 14:19:36 CEST 2009


Georg Brandl <georg at python.org> 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 lambda
expression you wrote is one of the correct ways to spell this.

----------
nosy: +georg.brandl
resolution:  -> wont fix
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6830>
_______________________________________


More information about the Python-bugs-list mailing list