You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2014-06-02.11:15:08.742>created_at=<Date2014-06-01.17:27:53.399>labels= ['expert-2to3']
title='2to3 does not fix zip in some cases'updated_at=<Date2017-01-19.14:45:23.578>user='https://bugs.python.org/RobertG'
For some reason, 2to3 fails to wrap the call to zip in a list, even though the 2to3 documentation says that there is a fixer which does this. Obviously, the generated code will not work in Python 3 since you can't subscript an iterator.
Activity
RobertG commentedon Jun 1, 2014
Consider this program
print foo(range(5), (0,9,-9))
With the default options, 2to3 rewrites this as
print(foo(list(range(5)), (0,9,-9)))
For some reason, 2to3 fails to wrap the call to zip in a list, even though the 2to3 documentation says that there is a fixer which does this. Obviously, the generated code will not work in Python 3 since you can't subscript an iterator.
berkerpeksag commentedon Jun 2, 2014
This is a duplicate of bpo-20742.
stuarteberg commentedon Jan 19, 2017
Already closed, but FWIW, I think this was incorrectly marked as a duplicate. bpo-20742 discusses a different issue related to lib2to3 and zip.
Meanwhile, this issue has been raised again in 28837, so I will continue the discussion there. (I have a patch.)