fixing precedence order, so that you can nest range comprehensions

This commit is contained in:
Jeremy Ashkenas
2010-01-01 11:19:57 -05:00
parent 305f883eab
commit e30a267c9d
3 changed files with 18 additions and 5 deletions

View File

@@ -0,0 +1,11 @@
multi_liner:
for x in [3..5]
for y in [3..5]
[x, y]
single_liner:
[x, y] for y in [3..5] for x in [3..5]
print(multi_liner.length is single_liner.length)
print(5 is multi_liner[2][2][1])
print(5 is single_liner[2][2][1])