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

Class MyClass

numpy/ma/tests/test_core.py:2520–2527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2518 assert_raises(TypeError, operator.truediv, a, "abc")
2519
2520 class MyClass:
2521 __array_priority__ = a.__array_priority__ + 1
2522
2523 def __mul__(self, other):
2524 return "My mul"
2525
2526 def __rmul__(self, other):
2527 return "My rmul"
2528
2529 me = MyClass()
2530 assert_(me * a == "My mul")

Callers 1

Calls

no outgoing calls

Tested by 1