@@ -13155,19 +13155,26 @@ PyUnicode_Split(PyObject *s, PyObject *sep, Py_ssize_t maxsplit)
13155
13155
str.split as unicode_split
13156
13156
13157
13157
sep: object = None
13158
- The delimiter according which to split the string.
13159
- None (the default value) means split according to any whitespace,
13160
- and discard empty strings from the result.
13158
+ The separator used to split the string.
13159
+
13160
+ When set to None (the default value), will split on any whitespace
13161
+ character (including \\n \\r \\t \\f and spaces) and will discard
13162
+ empty strings from the result.
13161
13163
maxsplit: Py_ssize_t = -1
13162
- Maximum number of splits to do .
13164
+ Maximum number of splits (starting from the left) .
13163
13165
-1 (the default value) means no limit.
13164
13166
13165
- Return a list of the words in the string, using sep as the delimiter string.
13167
+ Return a list of the substrings in the string, using sep as the separator string.
13168
+
13169
+ Note, str.split() is mainly useful for data that has been intentionally
13170
+ delimited. With natural text that includes punctuation, consider using
13171
+ the regular expression module.
13172
+
13166
13173
[clinic start generated code]*/
13167
13174
13168
13175
static PyObject *
13169
13176
unicode_split_impl (PyObject * self , PyObject * sep , Py_ssize_t maxsplit )
13170
- /*[clinic end generated code: output=3a65b1db356948dc input=606e750488a82359 ]*/
13177
+ /*[clinic end generated code: output=3a65b1db356948dc input=906d953b44efc43b ]*/
13171
13178
{
13172
13179
if (sep == Py_None )
13173
13180
return split (self , NULL , maxsplit );
@@ -13338,14 +13345,14 @@ PyUnicode_RSplit(PyObject *s, PyObject *sep, Py_ssize_t maxsplit)
13338
13345
/*[clinic input]
13339
13346
str.rsplit as unicode_rsplit = str.split
13340
13347
13341
- Return a list of the words in the string, using sep as the delimiter string.
13348
+ Return a list of the substrings in the string, using sep as the separator string.
13342
13349
13343
- Splits are done starting at the end of the string and working to the front.
13350
+ Splitting starts at the end of the string and works to the front.
13344
13351
[clinic start generated code]*/
13345
13352
13346
13353
static PyObject *
13347
13354
unicode_rsplit_impl (PyObject * self , PyObject * sep , Py_ssize_t maxsplit )
13348
- /*[clinic end generated code: output=c2b815c63bcabffc input=12ad4bf57dd35f15 ]*/
13355
+ /*[clinic end generated code: output=c2b815c63bcabffc input=ea78406060fce33c ]*/
13349
13356
{
13350
13357
if (sep == Py_None )
13351
13358
return rsplit (self , NULL , maxsplit );
0 commit comments