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

Method __new__

numpy/ma/tests/test_subclassing.py:26–29  ·  view source on GitHub ↗
(cls,arr,info={})

Source from the content-addressed store, hash-verified

24 # Defines a generic np.ndarray subclass, that stores some metadata
25 # in the dictionary `info`.
26 def __new__(cls,arr,info={}):
27 x = np.asanyarray(arr).view(cls)
28 x.info = info.copy()
29 return x
30
31 def __array_finalize__(self, obj):
32 super().__array_finalize__(obj)

Callers 3

__new__Method · 0.45
__new__Method · 0.45
test_reprMethod · 0.45

Calls 2

viewMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected