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

gh-110383: Fix docstring for str.rsplit maxsplit param to 'starting from the right' by sparrowt · Pull Request #113353 · python/cpython · GitHub

/ cpython Public
Closed
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
4 changes: 2 additions & 2 deletions Objects/clinic/unicodeobject.c.h

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

14 changes: 12 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 @@ -12686,7 +12686,17 @@ PyUnicode_RSplit(PyObject *s, PyObject *sep, Py_ssize_t maxsplit)
}

/*[clinic input]
str.rsplit as unicode_rsplit = str.split
str.rsplit as unicode_rsplit

sep: object = None
The separator used to split the string.

When set to None (the default value), will split on any whitespace
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 right).
-1 (the default value) means no limit.

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

Expand All @@ -12695,7 +12705,7 @@ Splitting starts at the end of the string and works to the front.

static PyObject *
unicode_rsplit_impl(PyObject *self, PyObject *sep, Py_ssize_t maxsplit)
/*[clinic end generated code: output=c2b815c63bcabffc input=ea78406060fce33c]*/
/*[clinic end generated code: output=c2b815c63bcabffc input=e58ee898aeab2b5e]*/
{
if (sep == Py_None)
return rsplit(self, NULL, maxsplit);
Expand Down

Back | FazBrowse Home | New Git URL