Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../usr/lib64/python2..../lib2to3/fixes
File: fix_zip.py
"""
[0] Fix | Delete
Fixer that changes zip(seq0, seq1, ...) into list(zip(seq0, seq1, ...)
[1] Fix | Delete
unless there exists a 'from future_builtins import zip' statement in the
[2] Fix | Delete
top-level namespace.
[3] Fix | Delete
[4] Fix | Delete
We avoid the transformation if the zip() call is directly contained in
[5] Fix | Delete
iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:.
[6] Fix | Delete
"""
[7] Fix | Delete
[8] Fix | Delete
# Local imports
[9] Fix | Delete
from .. import fixer_base
[10] Fix | Delete
from ..fixer_util import Name, Call, in_special_context
[11] Fix | Delete
[12] Fix | Delete
class FixZip(fixer_base.ConditionalFix):
[13] Fix | Delete
[14] Fix | Delete
BM_compatible = True
[15] Fix | Delete
PATTERN = """
[16] Fix | Delete
power< 'zip' args=trailer< '(' [any] ')' >
[17] Fix | Delete
>
[18] Fix | Delete
"""
[19] Fix | Delete
[20] Fix | Delete
skip_on = "future_builtins.zip"
[21] Fix | Delete
[22] Fix | Delete
def transform(self, node, results):
[23] Fix | Delete
if self.should_skip(node):
[24] Fix | Delete
return
[25] Fix | Delete
[26] Fix | Delete
if in_special_context(node):
[27] Fix | Delete
return None
[28] Fix | Delete
[29] Fix | Delete
new = node.clone()
[30] Fix | Delete
new.prefix = u""
[31] Fix | Delete
new = Call(Name(u"list"), [new])
[32] Fix | Delete
new.prefix = node.prefix
[33] Fix | Delete
return new
[34] Fix | Delete
[35] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function