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

Method __array_ufunc__

numpy/core/tests/test_multiarray.py:4081–4083  ·  view source on GitHub ↗
(self, ufunc, method, *inputs, **kwargs)

Source from the content-addressed store, hash-verified

4079 def test_pos_array_ufunc_override(self):
4080 class A(np.ndarray):
4081 def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
4082 return getattr(ufunc, method)(*[i.view(np.ndarray) for
4083 i in inputs], **kwargs)
4084 tst = np.array('foo').view(A)
4085 with assert_raises(TypeError):
4086 +tst

Callers

nothing calls this directly

Calls 1

viewMethod · 0.45

Tested by

no test coverage detected