Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/smanonr..../lib64/python3..../lib2to3/fixes
File: fix_repr.py
# Copyright 2006 Google, Inc. All Rights Reserved.
[0] Fix | Delete
# Licensed to PSF under a Contributor Agreement.
[1] Fix | Delete
[2] Fix | Delete
"""Fixer that transforms `xyzzy` into repr(xyzzy)."""
[3] Fix | Delete
[4] Fix | Delete
# Local imports
[5] Fix | Delete
from .. import fixer_base
[6] Fix | Delete
from ..fixer_util import Call, Name, parenthesize
[7] Fix | Delete
[8] Fix | Delete
[9] Fix | Delete
class FixRepr(fixer_base.BaseFix):
[10] Fix | Delete
[11] Fix | Delete
BM_compatible = True
[12] Fix | Delete
PATTERN = """
[13] Fix | Delete
atom < '`' expr=any '`' >
[14] Fix | Delete
"""
[15] Fix | Delete
[16] Fix | Delete
def transform(self, node, results):
[17] Fix | Delete
expr = results["expr"].clone()
[18] Fix | Delete
[19] Fix | Delete
if expr.type == self.syms.testlist1:
[20] Fix | Delete
expr = parenthesize(expr)
[21] Fix | Delete
return Call(Name("repr"), [expr], prefix=node.prefix)
[22] Fix | Delete
[23] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function