Skip to content

Commit dfb77db

Browse files
committed
python#2809: elaborate str.split docstring a bit.
1 parent 53905d8 commit dfb77db

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎Objects/stringobject.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,8 @@ PyDoc_STRVAR(split__doc__,
14981498
Return a list of the words in the string S, using sep as the\n\
14991499
delimiter string. If maxsplit is given, at most maxsplit\n\
15001500
splits are done. If sep is not specified or is None, any\n\
1501-
whitespace string is a separator.");
1501+
whitespace string is a separator and leading and trailing\n\
1502+
whitespace is stripped before splitting.");
15021503

15031504
static PyObject *
15041505
string_split(PyStringObject *self, PyObject *args)

‎Objects/unicodeobject.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7494,8 +7494,9 @@ PyDoc_STRVAR(split__doc__,
74947494
\n\
74957495
Return a list of the words in S, using sep as the\n\
74967496
delimiter string. If maxsplit is given, at most maxsplit\n\
7497-
splits are done. If sep is not specified or is None,\n\
7498-
any whitespace string is a separator.");
7497+
splits are done. If sep is not specified or is None, any\n\
7498+
whitespace string is a separator and leading and trailing\n\
7499+
whitespace is stripped before splitting.");
74997500

75007501
static PyObject*
75017502
unicode_split(PyUnicodeObject *self, PyObject *args)

0 commit comments

Comments
 (0)