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

Method __array_ufunc__

numpy/core/tests/test_multiarray.py:4007–4012  ·  view source on GitHub ↗
(self, ufunc, method, *inputs, **kw)

Source from the content-addressed store, hash-verified

4005 # regression test for github bug 4753
4006 class OutClass(np.ndarray):
4007 def __array_ufunc__(self, ufunc, method, *inputs, **kw):
4008 if 'out' in kw:
4009 tmp_kw = kw.copy()
4010 tmp_kw.pop('out')
4011 func = getattr(ufunc, method)
4012 kw['out'][0][...] = func(*inputs, **tmp_kw)
4013
4014 A = np.array([0]).view(OutClass)
4015 B = np.array([5])

Callers

nothing calls this directly

Calls 2

funcFunction · 0.50
copyMethod · 0.45

Tested by

no test coverage detected