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

Class MyClass

numpy/core/tests/test_overrides.py:713–720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

711 assert type(np.mean) is np.core._multiarray_umath._ArrayFunctionDispatcher
712
713 class MyClass:
714 def __array__(self):
715 # valid argument to mean:
716 return np.arange(3)
717
718 func1 = staticmethod(np.mean)
719 func2 = np.mean
720 func3 = classmethod(np.mean)
721
722 m = MyClass()
723 assert m.func1([10]) == 10

Callers 1

test_function_likeFunction · 0.70

Calls

no outgoing calls

Tested by 1

test_function_likeFunction · 0.56