Message219511
| Author |
RobertG |
| Recipients |
RobertG |
| Date |
2014年06月01日.17:27:53 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1401643673.43.0.6506799869.issue21628@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年06月01日 17:27:53 | RobertG | set | recipients:
+ RobertG |
| 2014年06月01日 17:27:53 | RobertG | set | messageid: <1401643673.43.0.6506799869.issue21628@psf.upfronthosting.co.za> |
| 2014年06月01日 17:27:53 | RobertG | link | issue21628 messages |
| 2014年06月01日 17:27:53 | RobertG | create |
|