[Python-checkins] r57893 - in sandbox/trunk/2to3: fixes/fix_filter.py fixes/fix_map.py tests/test_fixers.py

collin.winter python-checkins at python.org
Sat Sep 1 23:03:35 CEST 2007


Author: collin.winter
Date: Sat Sep  1 23:03:35 2007
New Revision: 57893

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 any() and all() to the list of special contexts for fix_map and fix_filter.


Modified: sandbox/trunk/2to3/fixes/fix_filter.py
==============================================================================
--- sandbox/trunk/2to3/fixes/fix_filter.py	(original)
+++ sandbox/trunk/2to3/fixes/fix_filter.py	Sat Sep  1 23:03:35 2007
@@ -65,7 +65,7 @@
 P1 = """
 power<
     ( 'iter' | 'list' | 'tuple' | 'sorted' | 'set' | 'enumerate' |
-      (any* trailer< '.' 'join' >) )
+      'any' | 'all' | (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	Sat Sep  1 23:03:35 2007
@@ -82,7 +82,7 @@
 P1 = """
 power<
     ( 'iter' | 'list' | 'tuple' | 'sorted' | 'set' | 'enumerate' |
-      (any* trailer< '.' 'join' >) )
+      'any' | 'all' | (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	Sat Sep  1 23:03:35 2007
@@ -2223,6 +2223,10 @@
         self.unchanged(a)
         a = """enumerate(filter(f, 'abc'))"""
         self.unchanged(a)
+        a = """any(filter(f, 'abc'))"""
+        self.unchanged(a)
+        a = """all(filter(f, 'abc'))"""
+        self.unchanged(a)
         a = """sorted(filter(f, 'abc'))"""
         self.unchanged(a)
         a = """sorted(filter(f, 'abc'), key=blah)"""
@@ -2306,6 +2310,10 @@
         self.unchanged(a)
         a = """enumerate(map(f, 'abc'))"""
         self.unchanged(a)
+        a = """any(map(f, 'abc'))"""
+        self.unchanged(a)
+        a = """all(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