K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / lib / python3.4 / lib2to3 / fixes /
server ip : 104.21.89.46

your ip : 172.69.130.124

H O M E


Filename/usr/lib/python3.4/lib2to3/fixes/fix_methodattrs.py
Size606
Permissionrw-r--r--
Ownerroot : root
Create time27-Apr-2025 09:50
Last modified11-Apr-2014 22:13
Last accessed06-Jul-2025 12:38
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
"""Fix bound method attributes (method.im_? -> method.__?__).
"""
# Author: Christian Heimes

# Local imports
from .. import fixer_base
from ..fixer_util import Name

MAP = {
"im_func" : "__func__",
"im_self" : "__self__",
"im_class" : "__self__.__class__"
}

class FixMethodattrs(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
power< any+ trailer< '.' attr=('im_func' | 'im_self' | 'im_class') > any* >
"""

def transform(self, node, results):
attr = results["attr"][0]
new = MAP[attr.value]
attr.replace(Name(new, prefix=attr.prefix))