default behavior
Christian Heimes
lists at cheimes.de
Sat Jul 31 14:00:08 EDT 2010
> The truth, as Christian says above and as Raymond Hettinger recently
> pointed out [1], is that __missing__ is used to *define* defaultdict as
> a subclass of dict -- it's not used *by* defaultdict.
Your answer is confusing even me. ;)
Let me try an easier to understand explanation. defaultdict *implements*
__missing__() to provide the default dict behavior. You don't have to
subclass from defaultdict to get the __missing__() feature. It's part of
the dict interface since Python 2.5.
Christian
More information about the Python-list
mailing list