home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- '''Fix bound method attributes (method.im_? -> method.__?__).
- '''
- 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):
- PATTERN = "\n power< any+ trailer< '.' attr=('im_func' | 'im_self' | 'im_class') > any* >\n "
-
- def transform(self, node, results):
- attr = results['attr'][0]
- new = MAP[attr.value]
- attr.replace(Name(new, prefix = attr.get_prefix()))
-
-
-