Update transition plan (according to e-mail from Collin Winter).

This commit is contained in:
Ka-Ping Yee 2007-03-07 02:19:15 +00:00
parent 7d90144644
commit 28566dec12
1 changed files with 18 additions and 10 deletions

View File

@ -148,8 +148,6 @@ In particular, Martin von Loewis writes [2]_::
Transition Plan Transition Plan
=============== ===============
(This section is likely to be updated.)
Two additional transformations will be added to the 2to3 translation Two additional transformations will be added to the 2to3 translation
tool [3]_: tool [3]_:
@ -159,13 +157,20 @@ tool [3]_:
to the built-in ``next`` function. For example, ``x.next()`` will to the built-in ``next`` function. For example, ``x.next()`` will
become ``next(x)``. become ``next(x)``.
If the module being processed already contains a binding for the name Collin Winter looked into the possibility of automatically deciding
``next``, the second transformation will not be done; instead, calls to whether to perform the second transformation depending on the presence
``x.next()`` will be replaced with ``x.__next__()`` and a warning will of a module-level binding to ``next`` [4]_ and found that it would be
be emitted. (Collin Winter has looked into this [4]_ and found that "ugly and slow". Instead, the translation tool will emit warnings
it's difficult to make the second transformation depend on the presence upon detecting such a binding. Collin has proposed warnings for the
of a module-level binding; warning about the existence of bindings to following conditions [5]_:
``next`` should be possible, though.)
* 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 Approval
@ -189,7 +194,10 @@ References
.. [4] PEP: rename it.next() to it.__next__()... (Collin Winter) .. [4] PEP: rename it.next() to it.__next__()... (Collin Winter)
http://mail.python.org/pipermail/python-3000/2007-March/006020.html 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 http://mail.python.org/pipermail/python-3000/2007-March/006027.html