@@ -738,7 +738,9 @@ \subsubsection{String Methods \label{string-methods}}
738738Return a list of the words in the string, using \var {sep} as the
739739delimiter string. If \var {maxsplit} is given, at most \var {maxsplit}
740740splits are done, the \emph {rightmost } ones. If \var {sep} is not specified
741- or \code {None}, any whitespace string is a separator.
741+ or \code {None}, any whitespace string is a separator. Except for splitting
742+ from the right, \method {rsplit()} behaves like \method {split()} which
743+ is described in detail below.
742744\versionadded {2.4}
743745\end {methoddesc }
744746
@@ -765,11 +767,13 @@ \subsubsection{String Methods \label{string-methods}}
765767separator returns an empty list.
766768
767769If \var {sep} is not specified or is \code {None}, a different splitting
768- algorithm is applied. Words are separated by arbitrary length strings of
769- whitespace characters (spaces, tabs, newlines, returns, and formfeeds).
770- Consecutive whitespace delimiters are treated as a single delimiter
771- (\samp {'1 2 3'.split()} returns \samp {['1', '2' , '3' ]}). Splitting an
772- empty string returns \samp {['']}.
770+ algorithm is applied. First, whitespace characters (spaces, tabs,
771+ newlines, returns, and formfeeds) are stripped from both ends. Then,
772+ words are separated by arbitrary length strings of whitespace
773+ characters. Consecutive whitespace delimiters are treated as a single
774+ delimiter (\samp {'1 2 3'.split()} returns \samp {['1', '2' , '3' ]}).
775+ Splitting an empty string or a string consisting of just whitespace
776+ will return \samp {['']}.
773777\end {methoddesc }
774778
775779\begin {methoddesc }[string]{splitlines}{\optional {keepends}}
0 commit comments