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

Method __array_function__

numpy/core/tests/test_overrides.py:293–298  ·  view source on GitHub ↗
(self, func, types, args, kwargs)

Source from the content-addressed store, hash-verified

291
292 class MyArray:
293 def __array_function__(self, func, types, args, kwargs):
294 if func not in HANDLED_FUNCTIONS:
295 return NotImplemented
296 if not all(issubclass(t, MyArray) for t in types):
297 return NotImplemented
298 return HANDLED_FUNCTIONS[func](*args, **kwargs)
299
300 def implements(numpy_function):
301 """Register an __array_function__ implementations."""

Callers 4

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

Calls 1

allFunction · 0.50

Tested by

no test coverage detected