[Python-Dev] [Python-checkins] cpython (3.2): #14957: clarify splitlines docs.

R. David Murray rdmurray at bitdance.com
Thu Jun 7 14:55:57 CEST 2012


On Thu, 07 Jun 2012 11:08:09 +0100, Sam Partington <sam.partington at gmail.com> wrote:
> > On Jun 2, 2012 6:21 AM, "r.david.murray" <python-checkins at python.org> wrote:
> >> +   For example, ``'ab c\n\nde fg\rkl\r\n'.splitlines()`` returns
> >> +   ``['ab c', '', 'de fg', 'kl']``, while the same call with
> >> ``splinelines(True)``
> >> +   returns ``['ab c\n', '\n, 'de fg\r', 'kl\r\n']``
> 
> Wouldn't that be better written as a doctest and so avoid any other typos?

Possibly, except (1) I don't think we currently actually test the doctests
in the python docs and (2) I'm following the style of the surrounding text
(the split examples just above this are in the same inline style.  Oh, and
(3) it would make the text longer, which could be considered a negative.

I have no objection myself to someone reformatting it, but if that is
done the whole chapter should be gone over and given a consistent style.

--David


More information about the Python-Dev mailing list