python-modernize/python-modernize — pull request #55 by takluyver (2014-09-07 22:23:03+00:00)
Title: Preserve Python 2 semantics for zip() and map()

Fix for issue #53. As described there, the simplistic fixers could break code that relied on zip() and map() being the greedy, list-returning versions. This fixes that by wrapping zip() and map() in `list()` calls unless we can detect that that's unnecessary (using 2to3's `in_special_context()` function).

This should be idempotent, using 2to3's ConditionalFixer class to skip the module if `six.moves.zip` (or map) is already imported.