MCPcopy Index your code
hub / github.com/numpy/numpy / __array_function__

Method __array_function__

numpy/_core/tests/test_overrides.py:304–309  ·  view source on GitHub ↗
(self, func, types, args, kwargs)

Source from the content-addressed store, hash-verified

302
303 class MyArray:
304 def __array_function__(self, func, types, args, kwargs):
305 if func not in HANDLED_FUNCTIONS:
306 return NotImplemented
307 if not all(issubclass(t, MyArray) for t in types):
308 return NotImplemented
309 return HANDLED_FUNCTIONS[func](*args, **kwargs)
310
311 def implements(numpy_function):
312 """Register an __array_function__ implementations."""

Callers 6

test_methodMethod · 0.45
test_no_wrapperMethod · 0.45
test_wrong_argumentsMethod · 0.45
__array_function__Method · 0.45
__array_function__Method · 0.45
__array_function__Method · 0.45

Calls 1

allFunction · 0.85

Tested by

no test coverage detected