Skip to content

Commit 4f7f452

Browse files
committed
pythongh-46236: Document PyUnicode_RSplit, PyUnicode_Partition and PyUnicode_RPartition
1 parent 2e8044a commit 4f7f452

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Doc/c-api/unicode.rst

+21
Original file line numberDiff line numberDiff line change
@@ -1399,13 +1399,34 @@ They all return ``NULL`` or ``-1`` if an exception occurs.
13991399
set. Separators are not included in the resulting list.
14001400
14011401
1402+
.. c:function:: PyObject* PyUnicode_RSplit(PyObject *unicode, PyObject *sep, Py_ssize_t maxsplit)
1403+
1404+
Similar to :c:func:`PyUnicode_Split`, but splitting will be done beginning
1405+
at the end of the string.
1406+
1407+
14021408
.. c:function:: PyObject* PyUnicode_Splitlines(PyObject *unicode, int keepends)
14031409
14041410
Split a Unicode string at line breaks, returning a list of Unicode strings.
14051411
CRLF is considered to be one line break. If *keepends* is ``0``, the Line break
14061412
characters are not included in the resulting strings.
14071413
14081414
1415+
.. c:function:: PyObject* PyUnicode_Partition(PyObject *unicode, PyObject *sep)
1416+
1417+
Split the string at the first occurrence of sep, and return a 3-tuple containing
1418+
the part before the separator, the separator itself, and the part after the separator.
1419+
If the separator is not found, return a 3-tuple containing the string itself,
1420+
followed by two empty strings.
1421+
1422+
1423+
.. c:function:: PyObject* PyUnicode_RPartition(PyObject *unicode, PyObject *sep)
1424+
1425+
Similar to :c:func:`PyUnicode_Partition`, but split the string at the last
1426+
occurrence of sep. If the separator is not found, return a 3-tuple containing
1427+
two empty strings, followed by the string itself.
1428+
1429+
14091430
.. c:function:: PyObject* PyUnicode_Join(PyObject *separator, PyObject *seq)
14101431
14111432
Join a sequence of strings using the given *separator* and return the resulting
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Document :c:func:`PyUnicode_RSplit`, :c:func:`PyUnicode_Partition` and
2+
:c:func:`PyUnicode_RPartition`.

0 commit comments

Comments
 (0)