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

Method f

Lib/test/test_capi/test_opt.py:939–949  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

937
938 def test_compare_int_eq_narrows_to_constant(self):
939 def f(n):
940 def return_1():
941 return 1
942
943 hits = 0
944 v = return_1()
945 for _ in range(n):
946 if v == 1:
947 if v == 1:
948 hits += 1
949 return hits
950
951 res, ex = self._run_with_optimizer(f, TIER2_THRESHOLD)
952 self.assertEqual(res, TIER2_THRESHOLD)

Callers

nothing calls this directly

Calls 9

mMethod · 0.95
mMethod · 0.95
mMethod · 0.95
sliceClass · 0.85
bit_lengthMethod · 0.80
CClass · 0.70
DClass · 0.70
EClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected