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 9c58f2c commit f9822e9Copy full SHA for f9822e9
Lib/test/test_capi/test_opt.py
@@ -1939,6 +1939,19 @@ def testfunc(n):
1939
self.assertNotIn("_GUARD_NOS_INT", uops)
1940
self.assertIn("_LOAD_CONST_INLINE_BORROW", uops)
1941
1942
+ def test_get_len_with_non_const_tuple(self):
1943
+ def testfunc(n):
1944
+ x = 0.0
1945
+ for _ in range(n):
1946
+ match (object(), object()):
1947
+ case [_, _]:
1948
+ x += 1.0
1949
+ return x
1950
+ res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD)
1951
+ self.assertEqual(int(res), TIER2_THRESHOLD)
1952
+ uops = get_opnames(ex)
1953
+ self.assertNotIn("_GUARD_NOS_INT", uops)
1954
+ self.assertIn("_LOAD_CONST_INLINE_BORROW", uops)
1955
1956
def test_get_len_with_non_tuple(self):
1957
def testfunc(n):
0 commit comments