Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/numpy/numpy
/ __new__
Method
__new__
numpy/core/tests/test_umath.py:4331–4334 ·
view source on GitHub ↗
(subtype, shape)
Source
from the content-addressed store, hash-verified
4329
4330
class
simple(np.ndarray):
4331
def
__new__(subtype, shape):
4332
self = np.ndarray.__new__(subtype, shape, dtype=object)
4333
self.fill(0)
4334
return
self
4335
4336
a = simple((3, 4))
4337
assert_equal(a+a, a)
Callers
nothing calls this directly
Calls
1
__new__
Method · 0.45
Tested by
no test coverage detected