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

Method __copy_internals

box/box.py:582–589  ·  view source on GitHub ↗

Carry instance-only attributes listed in `_box_internal_attrs`, and comments, over to `new`.

(self, new, deep=False, memo=None)

Source from the content-addressed store, hash-verified

580 return self[key]
581
582 def __copy_internals(self, new, deep=False, memo=None):
583 """Carry instance-only attributes listed in `_box_internal_attrs`, and comments, over to `new`."""
584 self._comment_copy_to(new)
585 for name in self._box_internal_attrs:
586 if name in self.__dict__:
587 value = self.__dict__[name]
588 object.__setattr__(new, name, copy.deepcopy(value, memo) if deep else value)
589 return new
590
591 def copy(self):
592 config = self.__box_config()

Callers 2

copyMethod · 0.95
__deepcopy__Method · 0.95

Calls 2

_comment_copy_toMethod · 0.95
__setattr__Method · 0.80

Tested by

no test coverage detected