This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2014年06月01日 17:27 by RobertG, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg219511 - (view) | Author: RobertG (RobertG) | Date: 2014年06月01日 17:27 | |
Consider this program def foo(a,b): return min(zip(a,b)[2]) print foo(range(5), (0,9,-9)) With the default options, 2to3 rewrites this as def foo(a,b): return min(zip(a,b)[2]) 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. |
|||
| msg219568 - (view) | Author: Berker Peksag (berker.peksag) * (Python committer) | Date: 2014年06月02日 11:15 | |
This is a duplicate of issue 20742. |
|||
| msg285793 - (view) | Author: Stuart Berg (stuarteberg) * | Date: 2017年01月19日 14:45 | |
Already closed, but FWIW, I think this was incorrectly marked as a duplicate. Issue 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.) |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:04 | admin | set | github: 65827 |
| 2017年01月19日 14:45:23 | stuarteberg | set | nosy:
+ stuarteberg messages: + msg285793 |
| 2014年06月02日 11:15:08 | berker.peksag | set | status: open -> closed superseder: 2to3 zip fixer doesn't fix for loops. nosy: + berker.peksag messages: + msg219568 resolution: duplicate stage: resolved |
| 2014年06月01日 18:53:27 | serhiy.storchaka | set | nosy:
+ benjamin.peterson |
| 2014年06月01日 17:27:53 | RobertG | create | |