[issue12613] itertools fixer fails

Vlada Peric report at bugs.python.org
Fri Jul 22 18:49:32 CEST 2011


New submission from Vlada Peric <vlada.peric at gmail.com>:

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.

----------
components: 2to3 (2.x to 3.0 conversion tool)
messages: 140897
nosy: VPeric
priority: normal
severity: normal
status: open
title: itertools fixer fails
versions: Python 2.7, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12613>
_______________________________________


More information about the Python-bugs-list mailing list