def __init__(self, data=None): def _normalize(d): for k, v in list(d.items()): if isinstance(v, dict) and not isinstance(v, ConfigDict): yield k, ConfigDict(v) else: yield k, v if data: if isinstance(data, ConfigDict): MergableDict.__init__(self, data) else: MergableDict.__init__(self, _normalize(data)) else: MergableDict.__init__(self) ConfigNode.__init__(self)
def copy(self): return ConfigDict(MergableDict.copy(self))