[Python-checkins] r56214 - sandbox/trunk/2to3/README
collin.winter
python-checkins at python.org
Mon Jul 9 16:17:01 CEST 2007
Author: collin.winter
Date: Mon Jul 9 16:17:01 2007
New Revision: 56214
Modified:
sandbox/trunk/2to3/README
Log:
Update the README with more recent fixers.
Modified: sandbox/trunk/2to3/README
==============================================================================
--- sandbox/trunk/2to3/README (original)
+++ sandbox/trunk/2to3/README Mon Jul 9 16:17:01 2007
@@ -34,6 +34,8 @@
* **fix_apply** - convert apply() calls to real function calls.
+* **fix_callable** - converts callable(obj) into hasattr(obj, '__call__').
+
* **fix_dict** - fix up dict.keys(), .values(), .items() and their iterator
versions.
@@ -41,6 +43,8 @@
* **fix_exec** - convert "exec" statements to exec() function calls.
+* **fix_filter** - changes filter(F, X) into list(filter(F, X)).
+
* **fix_has_key** - "d.has_key(x)" -> "x in d".
* **fix_input** - "input()" -> "eval(input())" (PEP 3111).
@@ -49,6 +53,8 @@
* **fix_long** - remove all usage of explicit longs in favor of ints.
+* **fix_map** - generally changes map(F, ...) into list(map(F, ...)).
+
* **fix_ne** - convert the "<>" operator to "!=".
* **fix_next** - fixer for it.next() -> next(it) (PEP 3114).
@@ -73,6 +79,8 @@
* **fix_tuple_params** - remove tuple parameters from function, method and
lambda declarations (PEP 3113).
+* **fix_unicode** - convert, e.g., u"..." to "...", unicode(x) to str(x), etc.
+
* **fix_xrange** - "xrange()" -> "range()".
@@ -119,6 +127,15 @@
This is seen frequently when dealing with OSError.
+fix_filter
+''''''''''
+
+The transformation is not correct if the original code depended on
+filter(F, X) returning a string if X is a string (or a tuple if X is a
+tuple, etc). That would require type inference, which we don't do. Python
+2.6's Python 3 compatibility mode should be used to detect such cases.
+
+
fix_has_key
'''''''''''
@@ -128,6 +145,15 @@
advised to pay close attention when using this fixer.
+fix_map
+'''''''
+
+The transformation is not correct if the original code was depending on
+map(F, X, Y, ...) to go on until the longest argument is exhausted,
+substituting None for missing values -- like zip(), it now stops as
+soon as the shortest argument is exhausted.
+
+
fix_raise
'''''''''
More information about the Python-checkins
mailing list