MCPcopy Index your code
hub / github.com/RustPython/RustPython / BadMultiply

Class BadMultiply

Lib/test/test_math.py:1360–1364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1358
1359 # Error in multiplication
1360 class BadMultiply:
1361 def __mul__(self, other):
1362 raise RuntimeError
1363 def __rmul__(self, other):
1364 raise RuntimeError
1365 with self.assertRaises(RuntimeError):
1366 sumprod([10, BadMultiply(), 30], [1, 2, 3])
1367 with self.assertRaises(RuntimeError):

Callers 2

testSumProdMethod · 0.85
test_prodMethod · 0.85

Calls

no outgoing calls

Tested by 2

testSumProdMethod · 0.68
test_prodMethod · 0.68