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 df61257 commit e6c6603Copy full SHA for e6c6603
Lib/test/test_capi/test_misc.py
@@ -2517,6 +2517,21 @@ def testfunc(x):
2517
uops = {opname for opname, _ in ex}
2518
self.assertIn("UNPACK_SEQUENCE", uops)
2519
2520
+ def test_for_iter(self):
2521
+ def testfunc(x):
2522
+ for i in range(x):
2523
+ i += 1
2524
+
2525
+ opt = _testinternalcapi.get_uop_optimizer()
2526
2527
+ with temporary_optimizer(opt):
2528
+ testfunc(10)
2529
2530
+ ex = get_first_executor(testfunc.__code__)
2531
+ self.assertIsNotNone(ex)
2532
+ uops = {opname for opname, _ in ex}
2533
+ self.assertIn("FOR_ITER_RANGE", uops)
2534
2535
2536
if __name__ == "__main__":
2537
unittest.main()
0 commit comments