[Python-checkins] r54191 - peps/trunk/pep-3114.txt

ka-ping.yee python-checkins at python.org
Wed Mar 7 03:19:21 CET 2007


Author: ka-ping.yee
Date: Wed Mar  7 03:19:15 2007
New Revision: 54191

Modified:
   peps/trunk/pep-3114.txt
Log:
Update transition plan (according to e-mail from Collin Winter).


Modified: peps/trunk/pep-3114.txt
==============================================================================
--- peps/trunk/pep-3114.txt	(original)
+++ peps/trunk/pep-3114.txt	Wed Mar  7 03:19:15 2007
@@ -148,8 +148,6 @@
 Transition Plan
 ===============
 
-(This section is likely to be updated.)
-
 Two additional transformations will be added to the 2to3 translation
 tool [3]_:
 
@@ -159,13 +157,20 @@
     to the built-in ``next`` function.  For example, ``x.next()`` will
     become ``next(x)``.
 
-If the module being processed already contains a binding for the name
-``next``, the second transformation will not be done; instead, calls to
-``x.next()`` will be replaced with ``x.__next__()`` and a warning will
-be emitted.  (Collin Winter has looked into this [4]_ and found that
-it's difficult to make the second transformation depend on the presence
-of a module-level binding; warning about the existence of bindings to
-``next`` should be possible, though.)
+Collin Winter looked into the possibility of automatically deciding
+whether to perform the second transformation depending on the presence
+of a module-level binding to ``next`` [4]_ and found that it would be
+"ugly and slow".  Instead, the translation tool will emit warnings
+upon detecting such a binding.  Collin has proposed warnings for the
+following conditions [5]_:
+
+*   Module-level assignments to ``next``.
+
+*   Module-level definitions of a function named ``next``.
+
+*   Module-level imports of the name ``next``.
+
+*   Assignments to ``__builtin__.next``.
 
 
 Approval
@@ -189,7 +194,10 @@
 .. [4] PEP: rename it.next() to it.__next__()... (Collin Winter)
    http://mail.python.org/pipermail/python-3000/2007-March/006020.html
 
-.. [5] PEP: rename it.next() to it.__next__()... (Guido van Rossum)
+.. [5] PEP 3113 transition plan
+   http://mail.python.org/pipermail/python-3000/2007-March/006044.html
+
+.. [6] PEP: rename it.next() to it.__next__()... (Guido van Rossum)
    http://mail.python.org/pipermail/python-3000/2007-March/006027.html
 
 


More information about the Python-checkins mailing list