Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ad2a9e72
Commit
ad2a9e72
authored
Sep 06, 2008
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
actually tell the name of the flag to use
parent
d5ff5b2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
Doc/library/2to3.rst
Doc/library/2to3.rst
+7
-7
No files found.
Doc/library/2to3.rst
View file @
ad2a9e72
...
...
@@ -42,7 +42,7 @@ original is also be made.) Writing the changes back is enabled with the
$ 2to3 -w example.py
After transformation :file:`example.py` looks like this::
After transformation
,
:file:`example.py` looks like this::
def greet(name):
print("Hello, {0}!".format(name))
...
...
@@ -79,12 +79,12 @@ flag. Note that *only* doctests will be refactored.
The :option:`-v` option enables the output of more information on the
translation process.
2to3 can also treat ``print`` as a function instead of a statement in the
grammar. This is useful when ``from __future__ import print_function`` is being
used. If this option is not given, the print fixer will surround print calls in
an extra set of parentheses because it cannot differentiate between the and
print statement with parentheses (such as ``print ("a" + "b" + "c")``) and a
true function call.
When the :option:`-p` is passed to it, 2to3 treats ``print`` as a function
instead of a statement. This is useful when ``from __future__ import
print_function`` is being used. If this option is not given, the print fixer
will surround print calls in an extra set of parentheses because it cannot
differentiate between the and print statement with parentheses (such as ``print
("a" + "b" + "c")``) and a
true function call.
:mod:`lib2to3` - 2to3's library
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment