Message336653
I did this on Windows 10:
P:\>python --version
Python 3.7.2
P:\>echo print 1, 2 > Test.py
P:\>python Test.py
File "Test.py", line 1
print 1, 2
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(1, 2)?
P:\>2to3 -w Test.py
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored Test.py
--- Test.py (original)
+++ Test.py (refactored)
@@ -1 +1 @@
-print 1, 2
+print(1, 2)
RefactoringTool: Files that were modified:
RefactoringTool: Test.py
P:\>python Test.py
1 2
P:\>2to3 -w Test.py
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored Test.py
--- Test.py (original)
+++ Test.py (refactored)
@@ -1 +1 @@
-print(1, 2)
+print((1, 2))
RefactoringTool: Files that were modified:
RefactoringTool: Test.py
P:\>python Test.py
(1, 2)
Note how "print 1, 2" first becomes "print(1, 2)" (expected), then becomes "print((1, 2))" in the following run. This changes the output of Test.py |
|
Date |
User |
Action |
Args |
2019-02-26 11:51:13 | bers | set | recipients:
+ bers |
2019-02-26 11:51:13 | bers | set | messageid: <1551181873.79.0.208082027128.issue36122@roundup.psfhosted.org> |
2019-02-26 11:51:13 | bers | link | issue36122 messages |
2019-02-26 11:51:13 | bers | create | |
|