The following Python 2.7 code is not converted correctly to Python 3 by 2to3:
c = [(1, 10), (2, 20)]
# get a tuple with the first entries of every tuple in c,
# i.e. (1, 2)
x = zip(*c)[0]
print x
The result is
c = [(1, 10), (2, 20)]
# get a tuple with the first entries of every tuple in c,
# i.e. (1, 2)
x = zip(*c)[0]
print(x)
However running it with python3 gives the following exception
Traceback (most recent call last):
File "result.py", line 7, in <module>
x = zip(*c)[0]
TypeError: 'zip' object is not subscriptable
Tested with 2to3-2.7 and 2to3-3.4 on debian stable (jessie) |