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 3d0f5d3 commit 6c04f67Copy full SHA for 6c04f67
1 file changed
Lib/test/test_capi/test_opt.py
@@ -2093,6 +2093,19 @@ def testfunc(n):
2093
self.assertNotIn("_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW", uops)
2094
self.assertNotIn("_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW", uops)
2095
2096
+ def test_call_isinstance_guards_pop_top(self):
2097
+ def testfunc(n):
2098
+ x = 0
2099
+ for _ in range(n):
2100
+ x += isinstance(42, int)
2101
+ return x
2102
+
2103
+ res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD)
2104
+ self.assertEqual(res, TIER2_THRESHOLD)
2105
+ self.assertIsNotNone(ex)
2106
+ uops = get_opnames(ex)
2107
+ self.assertIn("_POP_TOP_NOP", uops)
2108
2109
def test_call_list_append(self):
2110
def testfunc(n):
2111
a = []
0 commit comments