]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
discuss how to use -p
authorBenjamin Peterson <benjamin@python.org>
Mon, 9 Nov 2009 04:10:53 +0000 (04:10 +0000)
committerBenjamin Peterson <benjamin@python.org>
Mon, 9 Nov 2009 04:10:53 +0000 (04:10 +0000)
Doc/library/2to3.rst

index f37bb05565e4e90cd64ffde17a5d55e02bef394e..d9eb00c277f684ba886ed59f3e2702038d5e6d87 100644 (file)
@@ -86,6 +86,14 @@ document could also be refactored with this option.
 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: