The default factory is called without arguments to produce a new value
when a key is not present, in __getitem__ only. A defaultdict compares
equal to a dict with the same items.
a shallow copy of D.
|
|
|
|
new empty dictionary
|
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
|
|
|
__missing__(...)
__missing__(key) # Called by __getitem__ for missing key;
pseudo-code: if self.default_factory is None: raise KeyError(key)
self[key] = value = self.default_factory() return value |
|
|
|
__reduce__(...)
Return state information for pickling. |
|
|
|
|
a shallow copy of D.
|
|
Inherited from dict :
__cmp__ ,
__contains__ ,
__delitem__ ,
__eq__ ,
__ge__ ,
__getitem__ ,
__gt__ ,
__hash__ ,
__iter__ ,
__le__ ,
__len__ ,
__lt__ ,
__ne__ ,
__new__ ,
__setitem__ ,
clear ,
fromkeys ,
get ,
has_key ,
items ,
iteritems ,
iterkeys ,
itervalues ,
keys ,
pop ,
popitem ,
setdefault ,
update ,
values
|