Index: stdtypes.rst =================================================================== --- stdtypes.rst (revision 75645) +++ stdtypes.rst (working copy) @@ -1126,14 +1126,19 @@ splits are made). If *sep* is given, consecutive delimiters are not grouped together and are - deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns - ``['1', '', '2']``). The *sep* argument may consist of multiple characters - (for example, ``'1<>2<>3'.split('<>')`` returns ``['1', '2', '3']``). + deemed to delimit empty elements (for example, ``'1,,2'.split(',')`` returns + ``['1', '', '2']``). If the string begins or ends with *sep*, the resulting + list will begin or end with an empty element (for example, + ``',1,2,'.split(',')`` returns ``['', '1', '2', '']``). + The *sep* argument may be several characters long, but is considered a single + delimiter, *not* a set of characters to match; for example, + ``'1<>2<>3<4'.split('<>')`` returns ``['1', '2', '3<4']``. Splitting an empty string with a specified separator returns ``['']``. If *sep* is not specified or is ``None``, a different splitting algorithm is - applied: runs of consecutive whitespace are regarded as a single separator, - and the result will contain no empty strings at the start or end if the + applied: runs of consecutive whitespace (that is, those in + :mod:`string.whitespace`) are regarded as a single separator, + and the result will contain no empty elements at the start or end if the string has leading or trailing whitespace. Consequently, splitting an empty string or a string consisting of just whitespace with a ``None`` separator returns ``[]``.