New submission from Carsten: 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) ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 282075 nosy: cvk priority: normal severity: normal status: open title: 2to3 does not wrap zip correctly type: behavior versions: Python 2.7, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28837> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com