[docs] [issue15554] correct and clarify str.splitlines() documentation
report at bugs.python.org
Sat Aug 4 04:39:38 CEST 2012
New submission from Chris Jerdonek:
The documentation for str.splitlines()--
includes a statement that is not quite correct:
"Unlike split(), if the string ends with line boundary characters the returned list does not have an empty last element."
Also, the note about split() only applies when split() is passed a separator. For example--
Finally, the function's behavior on the empty string is another difference worth mentioning that is not covered by the existing note.
I am attaching a patch that addresses these points. Notice also that the patch phrases it not as whether the list *has* an empty last element, but whether an *additional* last element should be added, which is the more important point.
assignee: docs at python
keywords: easy, patch
nosy: cjerdonek, docs at python, jcea, pitrou
stage: patch review
title: correct and clarify str.splitlines() documentation
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file26680/issue-splitlines-docs-1.patch
Python tracker <report at bugs.python.org>
More information about the docs