ยปCore Development>Code coverage>Lib/lib2to3/tests/data/fixers/myfixes/fix_parrot.py

Python code coverage for Lib/lib2to3/tests/data/fixers/myfixes/fix_parrot.py

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