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 steven.daprano
Recipients Alexander Schrijver, barry, docs@python, ezio.melotti, gregory.p.smith, jwilk, lemburg, martin.panter, nascheme, python-dev, r.david.murray, scharron, serhiy.storchaka, steven.daprano, terry.reedy, vstinner
Date 2018-10-07.08:49:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538902193.95.0.545547206417.issue22232@psf.upfronthosting.co.za>
In-reply-to
Content
I don't like the idea of adding a second bool parameter to splitlines. Guido has a rough rule of thumb (which I agree with) of "no constant bool parameters". If people will typically call a function with some sort of "mode" parameter using a hard-coded bool, then we should usually prefer to split the two modes into distinct functions.

As an example, we have statistics.stdev and pstdev rather than stdev(data, population=False).

Obviously this is a guideline, not a hard rule, and there are exceptions. Such as str.splitlines :-)

In any case, I suggest a separate string method. Even though the name is slightly inaccurate, I suggest "ascii_splitlines" which I think is accurate enough to capture the spirit of what we intend (split on *only* \n \r and \r\n) and we can leave the details in the docs.
History
Date User Action Args
2018-10-07 08:49:54steven.dapranosetrecipients: + steven.daprano, lemburg, barry, nascheme, 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-07 08:49:53steven.dapranosetmessageid: <1538902193.95.0.545547206417.issue22232@psf.upfronthosting.co.za>
2018-10-07 08:49:53steven.dapranolinkissue22232 messages
2018-10-07 08:49:53steven.dapranocreate