defaultdict

Inheritance diagram of defaultdict
class defaultdict

defaultdict(default_factory=None, /, […]) –> 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.

Import from taurus.core.util.containers as:

from taurus.core.util.containers import defaultdict
copy() a shallow copy of D.
default_factory

Factory for default value called by __missing__().