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 nascheme
Recipients Alexander Schrijver, barry, docs@python, ezio.melotti, gregory.p.smith, jwilk, lemburg, martin.panter, nascheme, python-dev, r.david.murray, scharron, serhiy.storchaka, terry.reedy, vstinner
Date 2018-10-05.14:04:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538748261.98.0.545547206417.issue22232@psf.upfronthosting.co.za>
In-reply-to
Content
I've created a topic on this inside the "Ideas" area of discuss.python.org.  Sorry if that wasn't appropriate, not sure if I should have keep the discussion here.

Inada Naoki suggests creating a new method str.iterlines{[keepends]).  Given that people are -1 on changing str.splitlines, I think that's a good solution.  A new method is better yet if it would only split on '\n', that way fp.read().iterlines() matches fp.readlines().  It is what people seem to expect and is the most handy behaviour.  So, str and bytes would both get the new method and they would both split on only '\n'.

If we do that, I think nearly every use of splitlines() should get changed to iterlines().
History
Date User Action Args
2018-10-05 14:04:22naschemesetrecipients: + nascheme, lemburg, barry, terry.reedy, gregory.p.smith, vstinner, jwilk, ezio.melotti, r.david.murray, docs@python, python-dev, martin.panter, serhiy.storchaka, scharron, Alexander Schrijver
2018-10-05 14:04:21naschemesetmessageid: <1538748261.98.0.545547206417.issue22232@psf.upfronthosting.co.za>
2018-10-05 14:04:21naschemelinkissue22232 messages
2018-10-05 14:04:21naschemecreate