main icon indicating copy to clipboard operation
main copied to clipboard

IronPython treats lists in for loop the same as tuples

Open ironpythonbot opened this issue 10 years ago • 0 comments

Given the code:

x = {2:3}

for [[i], [j]] in x.items(): print(i, j)

IronPython parses and runs this code as if it was identical to:

x = {2:3}

for ((i), (j)) in x.items(): print(i, j)

CPython treats these two differently reporting the following error:

x = {2:3}

for [[i], [j]] in x.items(): print(i, j)
...
Traceback (most recent call last):
File "", line 1, in
TypeError: 'int' object is not iterable
^Z

Work Item Details

Original CodePlex Issue: Issue 30652 Status: Active Reason Closed: Unassigned Assigned to: Unassigned Reported on: May 9, 2011 at 7:03 PM Reported by: dinov Updated on: Feb 22, 2013 at 2:09 AM Updated by: jdhardy

ironpythonbot avatar Dec 09 '14 17:12 ironpythonbot