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

Class MyArray

numpy/core/tests/test_overrides.py:292–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290 HANDLED_FUNCTIONS = {}
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 6

test_interfaceMethod · 0.70
test_not_implementedMethod · 0.70
test_one_argMethod · 0.70
test_optional_argsMethod · 0.70
test_not_implementedMethod · 0.70
test_override_sumMethod · 0.70

Calls

no outgoing calls

Tested by 6

test_interfaceMethod · 0.56
test_not_implementedMethod · 0.56
test_one_argMethod · 0.56
test_optional_argsMethod · 0.56
test_not_implementedMethod · 0.56
test_override_sumMethod · 0.56