home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- '''Fixer for reduce().
-
- Makes sure reduce() is imported from the functools module if reduce is
- used in that module.
- '''
- from import pytree
- from import fixer_base
- from fixer_util import Name, Attr, touch_import
-
- class FixReduce(fixer_base.BaseFix):
- PATTERN = "\n power< 'reduce'\n trailer< '('\n arglist< (\n (not(argument<any '=' any>) any ','\n not(argument<any '=' any>) any) |\n (not(argument<any '=' any>) any ','\n not(argument<any '=' any>) any ','\n not(argument<any '=' any>) any)\n ) >\n ')' >\n >\n "
-
- def transform(self, node, results):
- touch_import('functools', 'reduce', node)
-
-
-