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 r.david.murray, vencabot_teppoo
Date 2010-01-05.04:55:12
SpamBayes Score 6.0355056e-08
Marked as misclassified No
Message-id <1262667315.38.0.438806134412.issue7638@psf.upfronthosting.co.za>
In-reply-to
Content
No apologies needed, but you probably aren't going to like the answer :)

First of all, a change like you propose would be unlikely to be accepted since it would create considerable backward-compatibility pain.

That aside, however, splitlines and split are not meant to be parallel.  They do two very different jobs.  splitlines is *line* oriented, and lines are understood to end with line ends.  The file equivalent of "" has length zero, and the unix 'wc' command reports it has having 0 lines.  A file containing "derp\n' is reported by wc to have one line, not two.  Files without a final line end are arguably broken, but all good tools accept that final line as a line, though some complain about it.  (And other tools break in various odd ways.)

If you want something parallel to split that handles line ends 'universally', try re.split with an appropriate regex.
History
Date User Action Args
2010-01-05 04:55:15r.david.murraysetrecipients: + r.david.murray, vencabot_teppoo
2010-01-05 04:55:15r.david.murraysetmessageid: <1262667315.38.0.438806134412.issue7638@psf.upfronthosting.co.za>
2010-01-05 04:55:13r.david.murraylinkissue7638 messages
2010-01-05 04:55:12r.david.murraycreate