Debian Codegraph @

lib-python/3/lib2to3/tests/data/fixers/myfixes/fix_parrot.py

raw symbols SCIP
1 from lib2to3.fixer_base import BaseFix
2 from lib2to3.fixer_util import Name
3
4 class FixParrot(BaseFix):
5 """
6 Change functions named 'parrot' to 'cheese'.
7 """
8
9 PATTERN = """funcdef < 'def' name='parrot' any* >"""
10
11 def transform(self, node, results):
12 name = results["name"]
13 name.replace(Name("cheese", name.prefix))