MCPcopy
hub / github.com/numpy/numpy / __deepcopy__

Method __deepcopy__

numpy/ma/core.py:6517–6531  ·  view source on GitHub ↗
(self, memo=None)

Source from the content-addressed store, hash-verified

6515 self.__getstate__())
6516
6517 def __deepcopy__(self, memo=None):
6518 from copy import deepcopy
6519 copied = MaskedArray.__new__(type(self), self, copy=True)
6520 if memo is None:
6521 memo = {}
6522 memo[id(self)] = copied
6523 for (k, v) in self.__dict__.items():
6524 copied.__dict__[k] = deepcopy(v, memo)
6525 # as clearly documented for np.copy(), you need to use
6526 # deepcopy() directly for arrays of object type that may
6527 # contain compound types--you cannot depend on normal
6528 # copy semantics to do the right thing here
6529 if self.dtype.hasobject:
6530 copied._data[...] = deepcopy(copied._data)
6531 return copied
6532
6533
6534def _mareconstruct(subtype, baseclass, baseshape, basetype,):

Callers

nothing calls this directly

Calls 2

itemsMethod · 0.80
__new__Method · 0.45

Tested by

no test coverage detected