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

Class A

numpy/core/tests/test_multiarray.py:4080–4083  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4078
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

Calls

no outgoing calls