+++ /dev/null
-# Copyright 2008 Armin Ronacher.\r
-# Licensed to PSF under a Contributor Agreement.\r
-\r
-"""Fixer for reduce().\r
-\r
-Makes sure reduce() is imported from the functools module if reduce is\r
-used in that module.\r
-"""\r
-\r
-from lib2to3 import fixer_base\r
-from lib2to3.fixer_util import touch_import\r
-\r
-\r
-\r
-class FixReduce(fixer_base.BaseFix):\r
-\r
- BM_compatible = True\r
- order = "pre"\r
-\r
- PATTERN = """\r
- power< 'reduce'\r
- trailer< '('\r
- arglist< (\r
- (not(argument<any '=' any>) any ','\r
- not(argument<any '=' any>) any) |\r
- (not(argument<any '=' any>) any ','\r
- not(argument<any '=' any>) any ','\r
- not(argument<any '=' any>) any)\r
- ) >\r
- ')' >\r
- >\r
- """\r
-\r
- def transform(self, node, results):\r
- touch_import(u'functools', u'reduce', node)\r