MCPcopy Create free account
hub / github.com/numpy/numpy / __deepcopy__

Method __deepcopy__

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

Source from the content-addressed store, hash-verified

6316 self.__getstate__())
6317
6318 def __deepcopy__(self, memo=None):
6319 from copy import deepcopy
6320 copied = MaskedArray.__new__(type(self), self, copy=True)
6321 if memo is None:
6322 memo = {}
6323 memo[id(self)] = copied
6324 for (k, v) in self.__dict__.items():
6325 copied.__dict__[k] = deepcopy(v, memo)
6326 # as clearly documented for np.copy(), you need to use
6327 # deepcopy() directly for arrays of object type that may
6328 # contain compound types--you cannot depend on normal
6329 # copy semantics to do the right thing here
6330 if self.dtype.hasobject:
6331 copied._data[...] = deepcopy(copied._data)
6332 return copied
6333
6334
6335def _mareconstruct(subtype, baseclass, baseshape, basetype,):

Callers

nothing calls this directly

Calls 1

__new__Method · 0.45

Tested by

no test coverage detected