Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35.4k
gh-46236: Document PyUnicode_RSplit, PyUnicode_Partition and PyUnicode_RPartition#130191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4f7f452f76e1afc19f46c0e52d8df02d59994dc5380b2d9bb0957364File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1398,6 +1398,20 @@ They all return ``NULL`` or ``-1`` if an exception occurs. | ||
| separator. At most *maxsplit* splits will be done. If negative, no limit is | ||
| set. Separators are not included in the resulting list. | ||
| On error, return ``NULL`` with an exception set. | ||
| Equivalent to :py:meth:`str.split`. | ||
| .. c:function:: PyObject* PyUnicode_RSplit(PyObject *unicode, PyObject *sep, Py_ssize_t maxsplit) | ||
| Similar to :c:func:`PyUnicode_Split`, but splitting will be done beginning | ||
| at the end of the string. | ||
| On error, return ``NULL`` with an exception set. | ||
| Equivalent to :py:meth:`str.rsplit`. | ||
| .. c:function:: PyObject* PyUnicode_Splitlines(PyObject *unicode, int keepends) | ||
| @@ -1406,6 +1420,33 @@ They all return ``NULL`` or ``-1`` if an exception occurs. | ||
| characters are not included in the resulting strings. | ||
| .. c:function:: PyObject* PyUnicode_Partition(PyObject *unicode, PyObject *sep) | ||
| Split a Unicode string at the first occurrence of *sep*, and return | ||
| a 3-tuple containing the part before the separator, the separator itself, | ||
| and the part after the separator. If the separator is not found, | ||
| return a 3-tuple containing the string itself, followed by two empty strings. | ||
vstinner marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
vstinner marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| *sep* must not be empty. | ||
cdce8p marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| On error, return ``NULL`` with an exception set. | ||
| Equivalent to :py:meth:`str.partition`. | ||
| .. c:function:: PyObject* PyUnicode_RPartition(PyObject *unicode, PyObject *sep) | ||
| Similar to :c:func:`PyUnicode_Partition`, but split a Unicode string at the | ||
| last occurrence of *sep*. If the separator is not found, return a 3-tuple | ||
| containing two empty strings, followed by the string itself. | ||
| *sep* must not be empty. | ||
cdce8p marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| On error, return ``NULL`` with an exception set. | ||
| Equivalent to :py:meth:`str.rpartition`. | ||
| .. c:function:: PyObject* PyUnicode_Join(PyObject *separator, PyObject *seq) | ||
| Join a sequence of strings using the given *separator* and return the resulting | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2655,13 +2655,26 @@ PyUnicode_Concat:PyObject*::+1: | ||
| PyUnicode_Concat:PyObject*:left:0: | ||
| PyUnicode_Concat:PyObject*:right:0: | ||
| PyUnicode_Partition:PyObject*::+1: | ||
| PyUnicode_Partition:PyObject*:unicode:0: | ||
| PyUnicode_Partition:PyObject*:sep:0: | ||
| PyUnicode_RPartition:PyObject*::+1: | ||
| PyUnicode_RPartition:PyObject*:unicode:0: | ||
| PyUnicode_RPartition:PyObject*:sep:0: | ||
| PyUnicode_RSplit:PyObject*::+1: | ||
| PyUnicode_RSplit:PyObject*:unicode:0: | ||
| PyUnicode_RSplit:PyObject*:sep:0: | ||
| PyUnicode_RSplit:Py_ssize_t:maxsplit:: | ||
| PyUnicode_Split:PyObject*::+1: | ||
| PyUnicode_Split:PyObject*:left:0: | ||
| PyUnicode_Split:PyObject*:right:0: | ||
| PyUnicode_Split:PyObject*:unicode:0: | ||
| PyUnicode_Split:PyObject*:sep:0: | ||
| PyUnicode_Split:Py_ssize_t:maxsplit:: | ||
| PyUnicode_Splitlines:PyObject*::+1: | ||
| PyUnicode_Splitlines:PyObject*:s:0: | ||
| PyUnicode_Splitlines:PyObject*:unicode:0: | ||
picnixz marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| PyUnicode_Splitlines:int:keepend:: | ||
| PyUnicode_Translate:PyObject*::+1: | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| C API: Document :c:func:`PyUnicode_RSplit`, :c:func:`PyUnicode_Partition` and | ||
| :c:func:`PyUnicode_RPartition`. |
Uh oh!
There was an error while loading. Please reload this page.