Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/smanonr..../lib64/python3..../lib2to3/fixes
File: fix_ne.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 turns <> into !=."""
[3] Fix | Delete
[4] Fix | Delete
# Local imports
[5] Fix | Delete
from .. import pytree
[6] Fix | Delete
from ..pgen2 import token
[7] Fix | Delete
from .. import fixer_base
[8] Fix | Delete
[9] Fix | Delete
[10] Fix | Delete
class FixNe(fixer_base.BaseFix):
[11] Fix | Delete
# This is so simple that we don't need the pattern compiler.
[12] Fix | Delete
[13] Fix | Delete
_accept_type = token.NOTEQUAL
[14] Fix | Delete
[15] Fix | Delete
def match(self, node):
[16] Fix | Delete
# Override
[17] Fix | Delete
return node.value == "<>"
[18] Fix | Delete
[19] Fix | Delete
def transform(self, node, results):
[20] Fix | Delete
new = pytree.Leaf(token.NOTEQUAL, "!=", prefix=node.prefix)
[21] Fix | Delete
return new
[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