mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
needforspeed: added rpartition implementation
This commit is contained in:
parent
be9f219e40
commit
b3167cbcd7
5 changed files with 166 additions and 2 deletions
|
@ -185,11 +185,12 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
|
|||
# define PyUnicode_GetSize PyUnicodeUCS2_GetSize
|
||||
# define PyUnicode_Join PyUnicodeUCS2_Join
|
||||
# define PyUnicode_Partition PyUnicodeUCS2_Partition
|
||||
# define PyUnicode_RPartition PyUnicodeUCS2_RPartition
|
||||
# define PyUnicode_RSplit PyUnicodeUCS2_RSplit
|
||||
# define PyUnicode_Replace PyUnicodeUCS2_Replace
|
||||
# define PyUnicode_Resize PyUnicodeUCS2_Resize
|
||||
# define PyUnicode_SetDefaultEncoding PyUnicodeUCS2_SetDefaultEncoding
|
||||
# define PyUnicode_Split PyUnicodeUCS2_Split
|
||||
# define PyUnicode_RSplit PyUnicodeUCS2_RSplit
|
||||
# define PyUnicode_Splitlines PyUnicodeUCS2_Splitlines
|
||||
# define PyUnicode_Tailmatch PyUnicodeUCS2_Tailmatch
|
||||
# define PyUnicode_Translate PyUnicodeUCS2_Translate
|
||||
|
@ -261,6 +262,8 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
|
|||
# define PyUnicode_GetSize PyUnicodeUCS4_GetSize
|
||||
# define PyUnicode_Join PyUnicodeUCS4_Join
|
||||
# define PyUnicode_Partition PyUnicodeUCS4_Partition
|
||||
# define PyUnicode_RPartition PyUnicodeUCS4_RPartition
|
||||
# define PyUnicode_RSplit PyUnicodeUCS4_RSplit
|
||||
# define PyUnicode_Replace PyUnicodeUCS4_Replace
|
||||
# define PyUnicode_Resize PyUnicodeUCS4_Resize
|
||||
# define PyUnicode_SetDefaultEncoding PyUnicodeUCS4_SetDefaultEncoding
|
||||
|
@ -1027,6 +1030,14 @@ PyAPI_FUNC(PyObject*) PyUnicode_Partition(
|
|||
PyObject *sep /* String separator */
|
||||
);
|
||||
|
||||
/* Partition a string using a given separator, searching from the end of the
|
||||
string. */
|
||||
|
||||
PyAPI_FUNC(PyObject*) PyUnicode_RPartition(
|
||||
PyObject *s, /* String to partition */
|
||||
PyObject *sep /* String separator */
|
||||
);
|
||||
|
||||
/* Split a string giving a list of Unicode strings.
|
||||
|
||||
If sep is NULL, splitting will be done at all whitespace
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue