Message327269
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. |
|
Date |
User |
Action |
Args |
2018-10-07 08:49:54 | steven.daprano | set | recipients:
+ 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:53 | steven.daprano | set | messageid: <1538902193.95.0.545547206417.issue22232@psf.upfronthosting.co.za> |
2018-10-07 08:49:53 | steven.daprano | link | issue22232 messages |
2018-10-07 08:49:53 | steven.daprano | create | |
|