MCPcopy Create free account
hub / github.com/cdgriffith/Box / __deepcopy__

Method __deepcopy__

box/box.py:479–489  ·  view source on GitHub ↗
(self, memodict=None)

Source from the content-addressed store, hash-verified

477 return self.copy()
478
479 def __deepcopy__(self, memodict=None) -> Box:
480 frozen = self._box_config["frozen_box"]
481 config = self.__box_config()
482 config["frozen_box"] = False
483 out = self._box_config["box_class"](**config)
484 memodict = memodict or {}
485 memodict[id(self)] = out
486 for k, v in self.items():
487 out[copy.deepcopy(k, memodict)] = copy.deepcopy(v, memodict)
488 out._box_config["frozen_box"] = frozen
489 return out
490
491 def __setstate__(self, state):
492 self._box_config = state["_box_config"]

Callers

nothing calls this directly

Calls 2

__box_configMethod · 0.95
itemsMethod · 0.95

Tested by

no test coverage detected