On Tue, Jun 21, 2022 at 3:49 AM Marco Sulla
<[email protected]> wrote:
>
> On Sun, 19 Jun 2022 at 03:06, Inada Naoki <[email protected]> wrote:
> > FWIW, I had proposed str.iterlines() to fix incompatibility between
> > IO.readlines() and str.splitlines().
>
> It's a good idea IMHO. In your mind, str.iterlines() will find only
> \n, \r and \r\n, as IO.readlines() do? I ask this because
> str.splitlines() finds all line boundary chars.
>

I don't remember the old discussion, but I think so.

Another idea is adding some option to `splitlines()` that uses only
universal newlines. (e.g. str.splitlines(keepends=False, *,
ascii=False))
Then we can add `str.iterlines` that have the same arguments to
`str.splitlines`.

-- 
Inada Naoki  <[email protected]>
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/RFCO3BHIKH2KZNIA2X5LCEY2OFMRJGDX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to