diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1351,11 +1351,14 @@ .. method:: str.splitlines([keepends]) - Return a list of the lines in the string, breaking at line boundaries. Line - breaks are not included in the resulting list unless *keepends* is given and - true. This method uses the universal newlines approach to splitting lines. - Unlike :meth:`~str.split`, if the string ends with line boundary characters - the returned list does ``not`` have an empty last element. + Return a list of the lines in the string, breaking at line boundaries. + This method uses the universal newlines approach to splitting lines. + Unlike :meth:`~str.split` when passed a separator, a terminal line break + does not delimit an additional empty line, and splitting an empty string + yields an empty list. + + Line breaks are not included in the resulting list unless *keepends* is + given and true. For example, ``'ab c\n\nde fg\rkl\r\n'.splitlines()`` returns ``['ab c', '', 'de fg', 'kl']``, while the same call with ``splitlines(True)``