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

Class CustomAdder

Lib/test/test_capi/test_opt.py:3749–3753  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3747
3748 def test_binary_op_refcount_elimination(self):
3749 class CustomAdder:
3750 def __init__(self, val):
3751 self.val = val
3752 def __add__(self, other):
3753 return CustomAdder(self.val + other.val)
3754
3755 def testfunc(n):
3756 a = CustomAdder(1)

Callers 2

__add__Method · 0.85
testfuncMethod · 0.85

Calls

no outgoing calls

Tested by 2

__add__Method · 0.68
testfuncMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…