]>
git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixes/fix_zip.py
63aac02a200a8fa4782daecac1f3cf450d2e22db
2 Fixer that changes zip(seq0, seq1, ...) into list(zip(seq0, seq1, ...)
3 unless there exists a 'from future_builtins import zip' statement in the
6 We avoid the transformation if the zip() call is directly contained in
7 iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:.
11 from .. import fixer_base
12 from ..fixer_util
import Name
, Call
, in_special_context
14 class FixZip(fixer_base
.ConditionalFix
):
18 power< 'zip' args=trailer< '(' [any] ')' >
22 skip_on
= "future_builtins.zip"
24 def transform(self
, node
, results
):
25 if self
.should_skip(node
):
28 if in_special_context(node
):
33 new
= Call(Name(u
"list"), [new
])
34 new
.prefix
= node
.prefix