[Python-checkins] r81411 - python/branches/release26-maint/Doc/library/2to3.rst (original) (raw)

benjamin.peterson python-checkins at python.org
Fri May 21 22:46:53 CEST 2010


Author: benjamin.peterson Date: Fri May 21 22:46:53 2010 New Revision: 81411

Log: update 2to3 docs

Modified: python/branches/release26-maint/Doc/library/2to3.rst

Modified: python/branches/release26-maint/Doc/library/2to3.rst

--- python/branches/release26-maint/Doc/library/2to3.rst (original) +++ python/branches/release26-maint/Doc/library/2to3.rst Fri May 21 22:46:53 2010 @@ -86,13 +86,21 @@ The :option:-v option enables output of more information on the translation process. +Since some print statements can be parsed as function calls or statements, 2to3 +cannot always read files containing the print function. When 2to3 detects the +presence of the from __future__ import print_function compiler directive, it +modifies its internal grammar to interpert :func:print as a function. This +change can also be enabled manually with the :option:-p flag. Use +:option:-p to run fixers on code that already has had its print statements +converted. + .. _2to3-fixers: Fixers

-Each step of tranforming code is encapsulated in a fixer. The command 2to3 +Each step of transforming code is encapsulated in a fixer. The command 2to3 -l`` lists them. As :ref:documented above <2to3-using>, each can be turned on and off individually. They are described here in more detail.

@@ -114,7 +122,8 @@

.. 2to3fixer:: callable

.. 2to3fixer:: dict

@@ -167,11 +176,11 @@

.. 2to3fixer:: idioms



More information about the Python-checkins mailing list