@@ -1376,6 +1376,20 @@ They all return ``NULL`` or ``-1`` if an exception occurs.
1376
1376
separator. At most *maxsplit * splits will be done. If negative, no limit is
1377
1377
set. Separators are not included in the resulting list.
1378
1378
1379
+ On error, return ``NULL `` with an exception set.
1380
+
1381
+ Equivalent to :py:meth: `str.split `.
1382
+
1383
+
1384
+ .. c :function :: PyObject* PyUnicode_RSplit (PyObject *unicode, PyObject *sep, Py_ssize_t maxsplit)
1385
+
1386
+ Similar to :c:func: `PyUnicode_Split `, but splitting will be done beginning
1387
+ at the end of the string.
1388
+
1389
+ On error, return ``NULL `` with an exception set.
1390
+
1391
+ Equivalent to :py:meth: `str.rsplit `.
1392
+
1379
1393
1380
1394
.. c :function :: PyObject* PyUnicode_Splitlines (PyObject *unicode, int keepends)
1381
1395
@@ -1384,6 +1398,33 @@ They all return ``NULL`` or ``-1`` if an exception occurs.
1384
1398
characters are not included in the resulting strings.
1385
1399
1386
1400
1401
+ .. c :function :: PyObject* PyUnicode_Partition (PyObject *unicode, PyObject *sep)
1402
+
1403
+ Split a Unicode string at the first occurrence of *sep *, and return
1404
+ a 3-tuple containing the part before the separator, the separator itself,
1405
+ and the part after the separator. If the separator is not found,
1406
+ return a 3-tuple containing the string itself, followed by two empty strings.
1407
+
1408
+ *sep * must not be empty.
1409
+
1410
+ On error, return ``NULL `` with an exception set.
1411
+
1412
+ Equivalent to :py:meth: `str.partition `.
1413
+
1414
+
1415
+ .. c :function :: PyObject* PyUnicode_RPartition (PyObject *unicode, PyObject *sep)
1416
+
1417
+ Similar to :c:func: `PyUnicode_Partition `, but split a Unicode string at the
1418
+ last occurrence of *sep *. If the separator is not found, return a 3-tuple
1419
+ containing two empty strings, followed by the string itself.
1420
+
1421
+ *sep * must not be empty.
1422
+
1423
+ On error, return ``NULL `` with an exception set.
1424
+
1425
+ Equivalent to :py:meth: `str.rpartition `.
1426
+
1427
+
1387
1428
.. c :function :: PyObject* PyUnicode_Join (PyObject *separator, PyObject *seq)
1388
1429
1389
1430
Join a sequence of strings using the given *separator * and return the resulting
0 commit comments