[issue13012] Allow keyword argument in str.splitlines()

2011-09-28 Thread Ezio Melotti
Changes by Ezio Melotti : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue13012] Allow keyword argument in str.splitlines()

2011-09-28 Thread Ezio Melotti
Ezio Melotti added the comment: I applied my patch, including the changes in Lib/collections/__init__.py, the issue can now be closed. -- assignee: -> mark.dickinson resolution: -> fixed stage: patch review -> committed/rejected ___ Python tracker

[issue13012] Allow keyword argument in str.splitlines()

2011-09-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 83f43b58c988 by Ezio Melotti in branch 'default': #13012: use splitlines(keepends=True/False) instead of splitlines(0/1). http://hg.python.org/cpython/rev/83f43b58c988 -- ___ Python tracker

[issue13012] Allow keyword argument in str.splitlines()

2011-09-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: Given that someone is willing to write a patch and someone else to review it, I am +1 on changing 0/1 to False/True anywhere appropriate in the stdlib. Ditto for using a new feature. The "# True == keep line ends" comment illustrates why the original patch is

[issue13012] Allow keyword argument in str.splitlines()

2011-09-24 Thread Ezio Melotti
Ezio Melotti added the comment: > Out of curiosity, what is typically the convention on that? In theory every issue should be about a single problem and therefore have a single patch to fix it. Sometimes a secondary "problem" that is not strictly related to the first one arises, for example

[issue13012] Allow keyword argument in str.splitlines()

2011-09-24 Thread Mark Dickinson
Mark Dickinson added the comment: Ezio's patch looks fine to me, though as Meador points out in the Rietveld review, there are a couple of omissions that could be fixed. Personally, I'm not so convinced of the value of upgrading all the existing uses of splitlines to use 'keepends'; I just w

[issue13012] Allow keyword argument in str.splitlines()

2011-09-24 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the reviews. Applied the first patch, plus Misc/NEWS entry, and minus the change to Lib/collections/__init__.py; I think that change belongs more with the second patch. -- ___ Python tracker

[issue13012] Allow keyword argument in str.splitlines()

2011-09-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0b2660384d4e by Mark Dickinson in branch 'default': Issue #13012: Allow 'keepends' to be passed as a keyword argument in str.splitlines, bytes.splitlines and bytearray.splitlines. http://hg.python.org/cpython/rev/0b2660384d4e -- nosy: +pyt

[issue13012] Allow keyword argument in str.splitlines()

2011-09-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: One changeset per issue is a general goal. So is the ability to review patches. Sometime people forget to add a News or Acks entry and have to followup with an addendum. (Mark's patch still lack that, for instance.) Sometimes a patch is so large that a review

[issue13012] Allow keyword argument in str.splitlines()

2011-09-23 Thread Meador Inge
Meador Inge added the comment: > Doing two separate commits is probably better. Out of curiosity, what is typically the convention on that? The devguide seems to suggest one changeset per issue: """ Just please make sure that you generate a single, condensed patch rather than a series of se

[issue13012] Allow keyword argument in str.splitlines()

2011-09-23 Thread Ezio Melotti
Ezio Melotti added the comment: The attached patch adds 'keepends=' to a few calls and replaces 0/1 with False/True. The patch can be applied after Mark's patch. Doing two separate commits is probably better. -- Added file: http://bugs.python.org/file23233/issue13012-repl.diff

[issue13012] Allow keyword argument in str.splitlines()

2011-09-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: I agree with Alex. The poorly documented fact that *some* C-coded functions cannot accept arguments identified by keyword rather than position is a bit hole in the function abstraction. +1 to the patch (and the int to bool change) -- nosy: +terry.reed

[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Meador Inge
Meador Inge added the comment: Patch looks good. I noticed a change in the conventional type for 'keepends' from 'int' to 'bool'. Several unit tests were updated to match this change. Perhaps other call sites should be updated too? A little greping shows: $ grep -Rl 'splitlines(0)' * --i

[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Ezio Melotti
Ezio Melotti added the comment: LGTM -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org

[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Mark Dickinson
Changes by Mark Dickinson : -- stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch. -- keywords: +patch Added file: http://bugs.python.org/file23208/issue13012.patch ___ Python tracker ___ __

[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Meador Inge
Meador Inge added the comment: +1; the keyword arg version is much more readable. -- nosy: +meador.inge ___ Python tracker ___ ___ Py

[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Alex Gaynor
Alex Gaynor added the comment: Personally, I regard every C function which, for obscure internal details, doesn't take keyword arguments as a sad bug, which should of course be fixed :) -- nosy: +alex ___ Python tracker

[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Mark Dickinson
Mark Dickinson added the comment: > (And applying the same change to bytes.splitlines.) Oh, and bytearray.splitlines, too. -- ___ Python tracker ___ ___

[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Mark Dickinson
New submission from Mark Dickinson : The docstring of str.splitlines says: splitlines(...) 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 an