Skip to content

Commit 5fba93a

Browse files
committed
tests: Add test for semantics of for-loop that optimisation can break.
1 parent c33ce60 commit 5fba93a

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/basics/for3.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# test assigning to iterator within the loop
2+
for i in range(2):
3+
print(i)
4+
i = 2
5+
6+
# test assigning to range parameter within the loop
7+
# (since we optimise for loops, this needs checking, currently it fails)
8+
#n = 2
9+
#for i in range(n):
10+
# print(i)
11+
# n = 0

0 commit comments

Comments
 (0)