summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-11-09 04:10:53 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-11-09 04:10:53 (GMT)
commit0ac6942a76067eeef9a32160c95216a9e58cb503 (patch)
tree1bd6008dd05375897a2590fc0126e7c365f5ff9f
parent813c43ab2591f9a61c222cb62b00bb2555b690bf (diff)
downloadcpython-0ac6942a76067eeef9a32160c95216a9e58cb503.zip
cpython-0ac6942a76067eeef9a32160c95216a9e58cb503.tar.gz
cpython-0ac6942a76067eeef9a32160c95216a9e58cb503.tar.bz2
discuss how to use -p
-rw-r--r--Doc/library/2to3.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst
index f37bb05..d9eb00c 100644
--- a/Doc/library/2to3.rst
+++ b/Doc/library/2to3.rst
@@ -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: