[Python-checkins] python/dist/src/Include unicodeobject.h, 2.41,
2.42
perky at users.sourceforge.net
perky at users.sourceforge.net
Mon Dec 15 13:49:21 EST 2003
Update of /cvsroot/python/python/dist/src/Include
In directory sc8-pr-cvs1:/tmp/cvs-serv28695/Include
Modified Files:
unicodeobject.h
Log Message:
Add rsplit method for str and unicode builtin types.
SF feature request #801847.
Original patch is written by Sean Reifschneider.
Index: unicodeobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/unicodeobject.h,v
retrieving revision 2.41
retrieving revision 2.42
diff -C2 -d -r2.41 -r2.42
*** unicodeobject.h 12 Aug 2002 08:19:10 -0000 2.41
--- unicodeobject.h 15 Dec 2003 18:49:19 -0000 2.42
***************
*** 186,189 ****
--- 186,190 ----
# 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
***************
*** 958,961 ****
--- 959,981 ----
PyObject *s, /* String to split */
int keepends /* If true, line end markers are included */
+ );
+
+ /* Split a string giving a list of Unicode strings.
+
+ If sep is NULL, splitting will be done at all whitespace
+ substrings. Otherwise, splits occur at the given separator.
+
+ At most maxsplit splits will be done. But unlike PyUnicode_Split
+ PyUnicode_RSplit splits from the end of the string. If negative,
+ no limit is set.
+
+ Separators are not included in the resulting list.
+
+ */
+
+ PyAPI_FUNC(PyObject*) PyUnicode_RSplit(
+ PyObject *s, /* String to split */
+ PyObject *sep, /* String separator */
+ int maxsplit /* Maxsplit count */
);
More information about the Python-checkins
mailing list