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 2011年07月22日 16:49 by VPeric, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue12613.patch | meador.inge, 2011年08月11日 04:13 | Patch against 2to3 tip | ||
| Messages (4) | |||
|---|---|---|---|
| msg140897 - (view) | Author: Vlada Peric (VPeric) | Date: 2011年07月22日 16:49 | |
The itertools fixer (izip -> zip, among others), fails for the following code: from itertools import izip print msg % str(bool(symbol_swapped) and list(izip(*swap_dict).next()) or symbols) It gets converted to: print(msg % str(bool(symbol_swapped) and list(next(izip(*swap_dict))) or symbols)) (note how izip is still there) I've worked aroudn this by introducing tmp = izip(...) and using that, but it'd be nice if 2to3 caught it by default. |
|||
| msg141836 - (view) | Author: Petri Lehtinen (petri.lehtinen) * (Python committer) | Date: 2011年08月09日 18:44 | |
A smaller snippet to reproduce: izip().next() This gets converted to: next(izip()) It seems to me that the pattern of the itertools fixer doesn't match to izip().something(), and thus this is skipped. |
|||
| msg141893 - (view) | Author: Meador Inge (meador.inge) * (Python committer) | Date: 2011年08月11日 04:13 | |
I see two problems that cause the posted test cases to fail: 1. The 'next' fixer runs before the 'itertools' fixer and strips out a 'power' node. This keeps the 'itertools' fixer from matching. 2. The 'itertools' fixer does not handle any 'trailer' nodes after the itertool function application it is transforming. I have fixed both of these issues in the attached patch. Full test suite run; no regressions. |
|||
| msg221605 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2014年06月26日 14:52 | |
The patch is small and looks clean to me. Can someone take a look with a view to committing please, thanks. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:20 | admin | set | github: 56822 |
| 2021年10月20日 23:00:55 | iritkatriel | set | status: open -> closed superseder: Close 2to3 issues and list them here resolution: wont fix stage: patch review -> resolved |
| 2019年03月15日 23:53:58 | BreamoreBoy | set | nosy:
- BreamoreBoy |
| 2014年06月26日 15:23:07 | berker.peksag | set | versions: + Python 3.5, - Python 3.2, Python 3.3 |
| 2014年06月26日 14:52:17 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages: + msg221605 |
| 2013年01月04日 17:37:03 | serhiy.storchaka | set | keywords:
+ needs review versions: + Python 3.4 |
| 2011年08月11日 04:13:20 | meador.inge | set | files:
+ issue12613.patch messages: + msg141893 keywords: + patch type: behavior stage: needs patch -> patch review |
| 2011年08月10日 20:29:18 | meador.inge | set | nosy:
+ meador.inge |
| 2011年08月09日 18:44:21 | petri.lehtinen | set | messages: + msg141836 |
| 2011年08月09日 18:20:51 | petri.lehtinen | set | nosy:
+ petri.lehtinen |
| 2011年07月25日 23:06:18 | Aaron.Meurer | set | nosy:
+ Aaron.Meurer |
| 2011年07月23日 02:52:12 | rhettinger | set | priority: normal -> high |
| 2011年07月22日 21:19:04 | eric.araujo | set | nosy:
+ eric.araujo stage: needs patch versions: + Python 3.3 |
| 2011年07月22日 16:56:09 | vstinner | set | nosy:
+ benjamin.peterson |
| 2011年07月22日 16:49:31 | VPeric | create | |