This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Wrong print for 2.7.9
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, johnboersma, python-dev
Priority: normal Keywords:

Created on 2015-02-05 01:12 by johnboersma, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg235414 - (view) Author: John Boersma (johnboersma) Date: 2015-02-05 01:12
In the tutorial for 2.7.9, in the section on quotes and the escape character, there is the following example text: 
>>> '"Isn\'t," she said.'
'"Isn\'t," she said.'
>>> print '"Isn\'t," she said.'
"Isn't," she said.
>>> s = 'First line.\nSecond line.'  # \n means newline
>>> s  # without print(), \n is included in the output
'First line.\nSecond line.'
>>> print s  # with print, \n produces a new line
First line.
Second line.

Note the print() in a comment. Isn't that Python 3 syntax? Should just be print for 2.7, I believe.
msg235415 - (view) Author: John Boersma (johnboersma) Date: 2015-02-05 01:13
To clarify - this is in tutorial section 3.1.2.
msg235417 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-02-05 03:07
New changeset 2bb5fa752bfc by Benjamin Peterson in branch '2.7':
remove parenthesis from print statement (closes #23396)
https://hg.python.org/cpython/rev/2bb5fa752bfc
History
Date User Action Args
2022-04-11 14:58:12adminsetgithub: 67585
2015-02-05 03:07:06python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg235417

resolution: fixed
stage: resolved
2015-02-05 01:13:58johnboersmasetmessages: + msg235415
2015-02-05 01:12:24johnboersmacreate