MCPcopy Index your code
hub / github.com/python/cpython / BadMultiply

Class BadMultiply

Lib/test/test_math.py:1382–1386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1380
1381 # Error in multiplication
1382 class BadMultiply:
1383 def __mul__(self, other):
1384 raise RuntimeError
1385 def __rmul__(self, other):
1386 raise RuntimeError
1387 with self.assertRaises(RuntimeError):
1388 sumprod([10, BadMultiply(), 30], [1, 2, 3])
1389 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…