defaultdict
¶

-
class
defaultdict
¶ Bases:
dict
defaultdict(default_factory[, …]) –> dict with default factory
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. All remaining arguments are treated the same as if they were passed to the dict constructor, including keyword arguments.
-
copy
() → a shallow copy of D.¶
-
default_factory
¶ Factory for default value called by __missing__().
-