Thanks to visit codestin.com Credit goes to github.com
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 62ce243Copy full SHA for 62ce243
Lib/test/test_capi/test_misc.py
@@ -2517,6 +2517,22 @@ 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(100)
2529
2530
+ ex = get_first_executor(testfunc.__code__)
2531
+ self.assertIsNotNone(ex)
2532
+ print(list(ex))
2533
+ uops = {opname for opname, _ in ex}
2534
+ self.assertIn("FOR_ITER_RANGE", uops)
2535
2536
2537
if __name__ == "__main__":
2538
unittest.main()
0 commit comments