003 File Manager
Current Path:
/usr/local/lib/python3.8/lib2to3/tests/data/fixers/myfixes
usr
/
local
/
lib
/
python3.8
/
lib2to3
/
tests
/
data
/
fixers
/
myfixes
/
📁
..
📄
__init__.py
(0 B)
📄
fix_explicit.py
(123 B)
📄
fix_first.py
(124 B)
📄
fix_last.py
(125 B)
📄
fix_parrot.py
(347 B)
📄
fix_preorder.py
(127 B)
Editing: fix_parrot.py
from lib2to3.fixer_base import BaseFix from lib2to3.fixer_util import Name class FixParrot(BaseFix): """ Change functions named 'parrot' to 'cheese'. """ PATTERN = """funcdef < 'def' name='parrot' any* >""" def transform(self, node, results): name = results["name"] name.replace(Name("cheese", name.prefix))
Upload File
Create Folder