[Python-checkins] r56436 - in sandbox/trunk/2to3: fixes/fix_filter.py fixes/fix_map.py tests/test_fixers.py
collin.winter
python-checkins at python.org
Wed Jul 18 00:13:19 CEST 2007
Author: collin.winter
Date: Wed Jul 18 00:13:19 2007
New Revision: 56436
Modified:
sandbox/trunk/2to3/ (props changed)
sandbox/trunk/2to3/fixes/fix_filter.py
sandbox/trunk/2to3/fixes/fix_map.py
sandbox/trunk/2to3/tests/test_fixers.py
Log:
Add enumerate() calls to the set of special contexts for fix_filter and fix_map.
Modified: sandbox/trunk/2to3/fixes/fix_filter.py
==============================================================================
--- sandbox/trunk/2to3/fixes/fix_filter.py (original)
+++ sandbox/trunk/2to3/fixes/fix_filter.py Wed Jul 18 00:13:19 2007
@@ -64,7 +64,7 @@
P1 = """
power<
- ( 'iter' | 'list' | 'tuple' | 'sorted' | 'set' |
+ ( 'iter' | 'list' | 'tuple' | 'sorted' | 'set' | 'enumerate' |
(any* trailer< '.' 'join' >) )
trailer< '(' node=any ')' >
any*
Modified: sandbox/trunk/2to3/fixes/fix_map.py
==============================================================================
--- sandbox/trunk/2to3/fixes/fix_map.py (original)
+++ sandbox/trunk/2to3/fixes/fix_map.py Wed Jul 18 00:13:19 2007
@@ -76,7 +76,7 @@
P1 = """
power<
- ( 'iter' | 'list' | 'tuple' | 'sorted' | 'set' |
+ ( 'iter' | 'list' | 'tuple' | 'sorted' | 'set' | 'enumerate' |
(any* trailer< '.' 'join' >) )
trailer< '(' node=any ')' >
any*
Modified: sandbox/trunk/2to3/tests/test_fixers.py
==============================================================================
--- sandbox/trunk/2to3/tests/test_fixers.py (original)
+++ sandbox/trunk/2to3/tests/test_fixers.py Wed Jul 18 00:13:19 2007
@@ -2208,6 +2208,8 @@
self.unchanged(a)
a = """tuple(filter(f, 'abc'))"""
self.unchanged(a)
+ a = """enumerate(filter(f, 'abc'))"""
+ self.unchanged(a)
a = """sorted(filter(f, 'abc'))"""
self.unchanged(a)
a = """sorted(filter(f, 'abc'), key=blah)"""
@@ -2277,6 +2279,8 @@
self.unchanged(a)
a = """tuple(map(f, 'abc'))"""
self.unchanged(a)
+ a = """enumerate(map(f, 'abc'))"""
+ self.unchanged(a)
a = """sorted(map(f, 'abc'))"""
self.unchanged(a)
a = """sorted(map(f, 'abc'), key=blah)"""
More information about the Python-checkins
mailing list