FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-110383: Improve accuracy of str.split() and str.rsplit() docstrings by erlend-aasland · Pull Request #113355 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) .h  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
8 changes: 5 additions & 3 deletions Objects/clinic/unicodeobject.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Objects/unicodeobject.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -12504,11 +12504,13 @@ str.split as unicode_split
character (including \n \r \t \f and spaces) and will discard
empty strings from the result.
maxsplit: Py_ssize_t = -1
Maximum number of splits (starting from the left).
Maximum number of splits.
-1 (the default value) means no limit.

Return a list of the substrings in the string, using sep as the separator string.

Splitting starts at the front of the string and works to the end.

Note, str.split() is mainly useful for data that has been intentionally
delimited. With natural text that includes punctuation, consider using
the regular expression module.
Expand All @@ -12517,7 +12519,7 @@ the regular expression module.

static PyObject *
unicode_split_impl(PyObject *self, PyObject *sep, Py_ssize_t maxsplit)
/*[clinic end generated code: output=3a65b1db356948dc input=07b9040d98c5fe8d]*/
/*[clinic end generated code: output=3a65b1db356948dc input=a29bcc0c7a5af0eb]*/
{
if (sep == Py_None)
return split(self, NULL, maxsplit);
Expand Down

Back | FazBrowse Home | New Git URL