We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2da71a commit 55119d3Copy full SHA for 55119d3
1 file changed
Lib/test/test_capi/test_opt.py
@@ -2094,6 +2094,19 @@ def testfunc(n):
2094
self.assertNotIn("_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW", uops)
2095
self.assertNotIn("_SWAP_CALL_TWO_LOAD_CONST_INLINE_BORROW", uops)
2096
2097
+ def test_call_isinstance_guards_pop_top(self):
2098
+ def testfunc(n):
2099
+ x = 0
2100
+ for _ in range(n):
2101
+ x += isinstance(42, int)
2102
+ return x
2103
+
2104
+ res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD)
2105
+ self.assertEqual(res, TIER2_THRESHOLD)
2106
+ self.assertIsNotNone(ex)
2107
+ uops = get_opnames(ex)
2108
+ self.assertIn("_POP_TOP_NOP", uops)
2109
2110
def test_call_list_append(self):
2111
def testfunc(n):
2112
a = []
0 commit comments