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.

Author r.david.murray
Recipients BreamoreBoy, Susan, docs@python, r.david.murray
Date 2014-08-08.13:35:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1407504955.0.0.897857871082.issue22170@psf.upfronthosting.co.za>
In-reply-to
Content
The comma means print doesn't add a newline to what is printed.  This is correct because the lines read from the file already have a newline at the end.  I can see how this example becomes a little confusing in a tutorial section on iterators, but as Mark said, if you try it, you find out that it works, and if you play with removing the comma you learn things about how python works with files (I don't remember how much of that is covered earlier in the tutorial).

In python3 this is clearer, because the equivalent line uses end='', making it clearer that it is intentional and meaningful.

Except...that in the python3 tutorial it currently *doesn't* use end='', so that example is in fact wrong and needs to be fixed :)
History
Date User Action Args
2014-08-08 13:35:55r.david.murraysetrecipients: + r.david.murray, docs@python, BreamoreBoy, Susan
2014-08-08 13:35:55r.david.murraysetmessageid: <1407504955.0.0.897857871082.issue22170@psf.upfronthosting.co.za>
2014-08-08 13:35:54r.david.murraylinkissue22170 messages
2014-08-08 13:35:54r.david.murraycreate