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 mark.dickinson
Recipients mark.dickinson
Date 2011-09-20.13:44:06
SpamBayes Score 7.69477e-08
Marked as misclassified No
Message-id <>
The docstring of str.splitlines says:

    S.splitlines([keepends]) -> list of strings
    Return a list of the lines in S, breaking at line boundaries.
    Line breaks are not included in the resulting list unless keepends
    is given and true.

Currently the optional argument can only be specified positionally.  What do people think about also allowing this argument to be specified by keyword?  (And applying the same change to bytes.splitlines.)

The main motivation here is readability:  in


it's fairly clear what the boolean argument is doing.  But in


it's much less clear.  (This came up during a Python training class that I was running recently.)  I'm not advocating making the argument keyword-only;  just allowing those who want to specify it by keyword to do so.

There are many other str methods that don't accept keyword arguments, but it's only this one where I think readability would really benefit.
Date User Action Args
2011-09-20 13:44:07mark.dickinsonsetrecipients: + mark.dickinson
2011-09-20 13:44:07mark.dickinsonsetmessageid: <>
2011-09-20 13:44:06mark.dickinsonlinkissue13012 messages
2011-09-20 13:44:06mark.dickinsoncreate