diff -r e1740afa1a04 Objects/bytearrayobject.c --- a/Objects/bytearrayobject.c Sat Feb 25 16:32:18 2012 +0100 +++ b/Objects/bytearrayobject.c Sun Feb 26 13:59:42 2012 +0100 @@ -1068,7 +1068,8 @@ } Py_LOCAL_INLINE(Py_ssize_t) -bytearray_find_internal(PyByteArrayObject *self, PyObject *args, int dir) +bytearray_find_internal(PyByteArrayObject *self, PyObject *args, PyObject *kwds, + int dir) { PyObject *subobj; char byte; @@ -1079,7 +1080,8 @@ Py_ssize_t res; if (!stringlib_parse_args_finds_byte("find/rfind/index/rindex", - args, &subobj, &byte, &start, &end)) + args, kwds, &subobj, &byte, &start, + &end)) return -2; if (subobj) { @@ -1119,9 +1121,9 @@ Return -1 on failure."); static PyObject * -bytearray_find(PyByteArrayObject *self, PyObject *args) +bytearray_find(PyByteArrayObject *self, PyObject *args, PyObject *kwds) { - Py_ssize_t result = bytearray_find_internal(self, args, +1); + Py_ssize_t result = bytearray_find_internal(self, args, kwds, +1); if (result == -2) return NULL; return PyLong_FromSsize_t(result); @@ -1135,7 +1137,7 @@ as in slice notation."); static PyObject * -bytearray_count(PyByteArrayObject *self, PyObject *args) +bytearray_count(PyByteArrayObject *self, PyObject *args, PyObject *kwds) { PyObject *sub_obj; const char *str = PyByteArray_AS_STRING(self), *sub; @@ -1146,7 +1148,7 @@ Py_buffer vsub; PyObject *count_obj; - if (!stringlib_parse_args_finds_byte("count", args, &sub_obj, &byte, + if (!stringlib_parse_args_finds_byte("count", args, kwds, &sub_obj, &byte, &start, &end)) return NULL; @@ -1205,9 +1207,9 @@ Like B.find() but raise ValueError when the subsection is not found."); static PyObject * -bytearray_index(PyByteArrayObject *self, PyObject *args) +bytearray_index(PyByteArrayObject *self, PyObject *args, PyObject *kwds) { - Py_ssize_t result = bytearray_find_internal(self, args, +1); + Py_ssize_t result = bytearray_find_internal(self, args, kwds, +1); if (result == -2) return NULL; if (result == -1) { @@ -1229,9 +1231,9 @@ Return -1 on failure."); static PyObject * -bytearray_rfind(PyByteArrayObject *self, PyObject *args) +bytearray_rfind(PyByteArrayObject *self, PyObject *args, PyObject *kwds) { - Py_ssize_t result = bytearray_find_internal(self, args, -1); + Py_ssize_t result = bytearray_find_internal(self, args, kwds, -1); if (result == -2) return NULL; return PyLong_FromSsize_t(result); @@ -1244,9 +1246,9 @@ Like B.rfind() but raise ValueError when the subsection is not found."); static PyObject * -bytearray_rindex(PyByteArrayObject *self, PyObject *args) +bytearray_rindex(PyByteArrayObject *self, PyObject *args, PyObject *kwds) { - Py_ssize_t result = bytearray_find_internal(self, args, -1); + Py_ssize_t result = bytearray_find_internal(self, args, kwds, -1); if (result == -2) return NULL; if (result == -1) { @@ -1334,14 +1336,15 @@ prefix can also be a tuple of bytes to try."); static PyObject * -bytearray_startswith(PyByteArrayObject *self, PyObject *args) +bytearray_startswith(PyByteArrayObject *self, PyObject *args, PyObject *kwds) { Py_ssize_t start = 0; Py_ssize_t end = PY_SSIZE_T_MAX; PyObject *subobj; int result; - if (!stringlib_parse_args_finds("startswith", args, &subobj, &start, &end)) + if (!stringlib_parse_args_finds("startswith", args, kwds, &subobj, &start, + &end)) return NULL; if (PyTuple_Check(subobj)) { Py_ssize_t i; @@ -1377,14 +1380,15 @@ suffix can also be a tuple of bytes to try."); static PyObject * -bytearray_endswith(PyByteArrayObject *self, PyObject *args) +bytearray_endswith(PyByteArrayObject *self, PyObject *args, PyObject *kwds) { Py_ssize_t start = 0; Py_ssize_t end = PY_SSIZE_T_MAX; PyObject *subobj; int result; - if (!stringlib_parse_args_finds("endswith", args, &subobj, &start, &end)) + if (!stringlib_parse_args_finds("endswith", args, kwds, &subobj, &start, + &end)) return NULL; if (PyTuple_Check(subobj)) { Py_ssize_t i; @@ -2829,16 +2833,16 @@ {"center", (PyCFunction)stringlib_center, METH_VARARGS, center__doc__}, {"clear", (PyCFunction)bytearray_clear, METH_NOARGS, clear__doc__}, {"copy", (PyCFunction)bytearray_copy, METH_NOARGS, copy__doc__}, - {"count", (PyCFunction)bytearray_count, METH_VARARGS, count__doc__}, + {"count", (PyCFunction)bytearray_count, METH_VARARGS | METH_KEYWORDS, count__doc__}, {"decode", (PyCFunction)bytearray_decode, METH_VARARGS | METH_KEYWORDS, decode_doc}, - {"endswith", (PyCFunction)bytearray_endswith, METH_VARARGS, endswith__doc__}, + {"endswith", (PyCFunction)bytearray_endswith, METH_VARARGS | METH_KEYWORDS, endswith__doc__}, {"expandtabs", (PyCFunction)stringlib_expandtabs, METH_VARARGS, expandtabs__doc__}, {"extend", (PyCFunction)bytearray_extend, METH_O, extend__doc__}, - {"find", (PyCFunction)bytearray_find, METH_VARARGS, find__doc__}, + {"find", (PyCFunction)bytearray_find, METH_VARARGS | METH_KEYWORDS, find__doc__}, {"fromhex", (PyCFunction)bytearray_fromhex, METH_VARARGS|METH_CLASS, fromhex_doc}, - {"index", (PyCFunction)bytearray_index, METH_VARARGS, index__doc__}, + {"index", (PyCFunction)bytearray_index, METH_VARARGS | METH_KEYWORDS, index__doc__}, {"insert", (PyCFunction)bytearray_insert, METH_VARARGS, insert__doc__}, {"isalnum", (PyCFunction)stringlib_isalnum, METH_NOARGS, _Py_isalnum__doc__}, @@ -2865,8 +2869,8 @@ {"remove", (PyCFunction)bytearray_remove, METH_O, remove__doc__}, {"replace", (PyCFunction)bytearray_replace, METH_VARARGS, replace__doc__}, {"reverse", (PyCFunction)bytearray_reverse, METH_NOARGS, reverse__doc__}, - {"rfind", (PyCFunction)bytearray_rfind, METH_VARARGS, rfind__doc__}, - {"rindex", (PyCFunction)bytearray_rindex, METH_VARARGS, rindex__doc__}, + {"rfind", (PyCFunction)bytearray_rfind, METH_VARARGS | METH_KEYWORDS, rfind__doc__}, + {"rindex", (PyCFunction)bytearray_rindex, METH_VARARGS | METH_KEYWORDS, rindex__doc__}, {"rjust", (PyCFunction)stringlib_rjust, METH_VARARGS, rjust__doc__}, {"rpartition", (PyCFunction)bytearray_rpartition, METH_O, rpartition__doc__}, {"rsplit", (PyCFunction)bytearray_rsplit, METH_VARARGS, rsplit__doc__}, @@ -2874,7 +2878,7 @@ {"split", (PyCFunction)bytearray_split, METH_VARARGS, split__doc__}, {"splitlines", (PyCFunction)bytearray_splitlines, METH_VARARGS | METH_KEYWORDS, splitlines__doc__}, - {"startswith", (PyCFunction)bytearray_startswith, METH_VARARGS , + {"startswith", (PyCFunction)bytearray_startswith, METH_VARARGS | METH_KEYWORDS, startswith__doc__}, {"strip", (PyCFunction)bytearray_strip, METH_VARARGS, strip__doc__}, {"swapcase", (PyCFunction)stringlib_swapcase, METH_NOARGS, diff -r e1740afa1a04 Objects/bytesobject.c --- a/Objects/bytesobject.c Sat Feb 25 16:32:18 2012 +0100 +++ b/Objects/bytesobject.c Sun Feb 26 13:59:42 2012 +0100 @@ -1216,7 +1216,8 @@ } Py_LOCAL_INLINE(Py_ssize_t) -bytes_find_internal(PyBytesObject *self, PyObject *args, int dir) +bytes_find_internal(PyBytesObject *self, PyObject *args, PyObject *kwds, + int dir) { PyObject *subobj; char byte; @@ -1227,7 +1228,8 @@ Py_ssize_t res; if (!stringlib_parse_args_finds_byte("find/rfind/index/rindex", - args, &subobj, &byte, &start, &end)) + args, kwds, &subobj, &byte, &start, + &end)) return -2; if (subobj) { @@ -1268,9 +1270,9 @@ Return -1 on failure."); static PyObject * -bytes_find(PyBytesObject *self, PyObject *args) +bytes_find(PyBytesObject *self, PyObject *args, PyObject *kwds) { - Py_ssize_t result = bytes_find_internal(self, args, +1); + Py_ssize_t result = bytes_find_internal(self, args, kwds, +1); if (result == -2) return NULL; return PyLong_FromSsize_t(result); @@ -1283,9 +1285,9 @@ Like B.find() but raise ValueError when the substring is not found."); static PyObject * -bytes_index(PyBytesObject *self, PyObject *args) +bytes_index(PyBytesObject *self, PyObject *args, PyObject *kwds) { - Py_ssize_t result = bytes_find_internal(self, args, +1); + Py_ssize_t result = bytes_find_internal(self, args, kwds, +1); if (result == -2) return NULL; if (result == -1) { @@ -1307,9 +1309,9 @@ Return -1 on failure."); static PyObject * -bytes_rfind(PyBytesObject *self, PyObject *args) +bytes_rfind(PyBytesObject *self, PyObject *args, PyObject *kwds) { - Py_ssize_t result = bytes_find_internal(self, args, -1); + Py_ssize_t result = bytes_find_internal(self, args, kwds, -1); if (result == -2) return NULL; return PyLong_FromSsize_t(result); @@ -1322,9 +1324,9 @@ Like B.rfind() but raise ValueError when the substring is not found."); static PyObject * -bytes_rindex(PyBytesObject *self, PyObject *args) +bytes_rindex(PyBytesObject *self, PyObject *args, PyObject *kwds) { - Py_ssize_t result = bytes_find_internal(self, args, -1); + Py_ssize_t result = bytes_find_internal(self, args, kwds, -1); if (result == -2) return NULL; if (result == -1) { @@ -1475,7 +1477,7 @@ as in slice notation."); static PyObject * -bytes_count(PyBytesObject *self, PyObject *args) +bytes_count(PyBytesObject *self, PyObject *args, PyObject *kwds) { PyObject *sub_obj; const char *str = PyBytes_AS_STRING(self), *sub; @@ -1486,7 +1488,7 @@ Py_buffer vsub; PyObject *count_obj; - if (!stringlib_parse_args_finds_byte("count", args, &sub_obj, &byte, + if (!stringlib_parse_args_finds_byte("count", args, kwds, &sub_obj, &byte, &start, &end)) return NULL; @@ -2208,14 +2210,15 @@ prefix can also be a tuple of bytes to try."); static PyObject * -bytes_startswith(PyBytesObject *self, PyObject *args) +bytes_startswith(PyBytesObject *self, PyObject *args, PyObject *kwds) { Py_ssize_t start = 0; Py_ssize_t end = PY_SSIZE_T_MAX; PyObject *subobj; int result; - if (!stringlib_parse_args_finds("startswith", args, &subobj, &start, &end)) + if (!stringlib_parse_args_finds("startswith", args, kwds, &subobj, &start, + &end)) return NULL; if (PyTuple_Check(subobj)) { Py_ssize_t i; @@ -2252,14 +2255,15 @@ suffix can also be a tuple of bytes to try."); static PyObject * -bytes_endswith(PyBytesObject *self, PyObject *args) +bytes_endswith(PyBytesObject *self, PyObject *args, PyObject *kwds) { Py_ssize_t start = 0; Py_ssize_t end = PY_SSIZE_T_MAX; PyObject *subobj; int result; - if (!stringlib_parse_args_finds("endswith", args, &subobj, &start, &end)) + if (!stringlib_parse_args_finds("endswith", args, kwds, &subobj, &start, + &end)) return NULL; if (PyTuple_Check(subobj)) { Py_ssize_t i; @@ -2433,16 +2437,16 @@ {"capitalize", (PyCFunction)stringlib_capitalize, METH_NOARGS, _Py_capitalize__doc__}, {"center", (PyCFunction)stringlib_center, METH_VARARGS, center__doc__}, - {"count", (PyCFunction)bytes_count, METH_VARARGS, count__doc__}, + {"count", (PyCFunction)bytes_count, METH_VARARGS | METH_KEYWORDS, count__doc__}, {"decode", (PyCFunction)bytes_decode, METH_VARARGS | METH_KEYWORDS, decode__doc__}, - {"endswith", (PyCFunction)bytes_endswith, METH_VARARGS, + {"endswith", (PyCFunction)bytes_endswith, METH_VARARGS | METH_KEYWORDS, endswith__doc__}, {"expandtabs", (PyCFunction)stringlib_expandtabs, METH_VARARGS, expandtabs__doc__}, - {"find", (PyCFunction)bytes_find, METH_VARARGS, find__doc__}, + {"find", (PyCFunction)bytes_find, METH_VARARGS | METH_KEYWORDS, find__doc__}, {"fromhex", (PyCFunction)bytes_fromhex, METH_VARARGS|METH_CLASS, fromhex_doc}, - {"index", (PyCFunction)bytes_index, METH_VARARGS, index__doc__}, + {"index", (PyCFunction)bytes_index, METH_VARARGS | METH_KEYWORDS, index__doc__}, {"isalnum", (PyCFunction)stringlib_isalnum, METH_NOARGS, _Py_isalnum__doc__}, {"isalpha", (PyCFunction)stringlib_isalpha, METH_NOARGS, @@ -2465,8 +2469,8 @@ _Py_maketrans__doc__}, {"partition", (PyCFunction)bytes_partition, METH_O, partition__doc__}, {"replace", (PyCFunction)bytes_replace, METH_VARARGS, replace__doc__}, - {"rfind", (PyCFunction)bytes_rfind, METH_VARARGS, rfind__doc__}, - {"rindex", (PyCFunction)bytes_rindex, METH_VARARGS, rindex__doc__}, + {"rfind", (PyCFunction)bytes_rfind, METH_VARARGS | METH_KEYWORDS, rfind__doc__}, + {"rindex", (PyCFunction)bytes_rindex, METH_VARARGS | METH_KEYWORDS, rindex__doc__}, {"rjust", (PyCFunction)stringlib_rjust, METH_VARARGS, rjust__doc__}, {"rpartition", (PyCFunction)bytes_rpartition, METH_O, rpartition__doc__}, @@ -2475,7 +2479,7 @@ {"split", (PyCFunction)bytes_split, METH_VARARGS, split__doc__}, {"splitlines", (PyCFunction)bytes_splitlines, METH_VARARGS | METH_KEYWORDS, splitlines__doc__}, - {"startswith", (PyCFunction)bytes_startswith, METH_VARARGS, + {"startswith", (PyCFunction)bytes_startswith, METH_VARARGS | METH_KEYWORDS, startswith__doc__}, {"strip", (PyCFunction)bytes_strip, METH_VARARGS, strip__doc__}, {"swapcase", (PyCFunction)stringlib_swapcase, METH_NOARGS, diff -r e1740afa1a04 Objects/stringlib/find.h --- a/Objects/stringlib/find.h Sat Feb 25 16:32:18 2012 +0100 +++ b/Objects/stringlib/find.h Sun Feb 26 13:59:42 2012 +0100 @@ -103,8 +103,8 @@ Py_LOCAL_INLINE(int) STRINGLIB(parse_args_finds)(const char * function_name, PyObject *args, - PyObject **subobj, - Py_ssize_t *start, Py_ssize_t *end) + PyObject *kwds, PyObject **subobj, + Py_ssize_t *start, Py_ssize_t *end) { PyObject *tmp_subobj; Py_ssize_t tmp_start = 0; @@ -112,11 +112,13 @@ PyObject *obj_start=Py_None, *obj_end=Py_None; char format[FORMAT_BUFFER_SIZE] = "O|OO:"; size_t len = strlen(format); + static char *kwlist[] = {"sub", "start", "end", 0}; strncpy(format + len, function_name, FORMAT_BUFFER_SIZE - len - 1); format[FORMAT_BUFFER_SIZE - 1] = '\0'; - if (!PyArg_ParseTuple(args, format, &tmp_subobj, &obj_start, &obj_end)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, format, kwlist, &tmp_subobj, + &obj_start, &obj_end)) return 0; /* To support None in "start" and "end" arguments, meaning @@ -151,12 +153,12 @@ Py_LOCAL_INLINE(int) STRINGLIB(parse_args_finds_unicode)(const char * function_name, PyObject *args, - PyObject **substring, - Py_ssize_t *start, Py_ssize_t *end) + PyObject *kwds, PyObject **substring, + Py_ssize_t *start, Py_ssize_t *end) { PyObject *tmp_substring; - if(STRINGLIB(parse_args_finds)(function_name, args, &tmp_substring, + if(STRINGLIB(parse_args_finds)(function_name, args, kwds, &tmp_substring, start, end)) { tmp_substring = PyUnicode_FromObject(tmp_substring); if (!tmp_substring) @@ -181,14 +183,14 @@ Py_LOCAL_INLINE(int) STRINGLIB(parse_args_finds_byte)(const char *function_name, PyObject *args, - PyObject **subobj, char *byte, + PyObject *kwds, PyObject **subobj, char *byte, Py_ssize_t *start, Py_ssize_t *end) { PyObject *tmp_subobj; Py_ssize_t ival; PyObject *err; - if(!STRINGLIB(parse_args_finds)(function_name, args, &tmp_subobj, + if(!STRINGLIB(parse_args_finds)(function_name, args, kwds, &tmp_subobj, start, end)) return 0; diff -r e1740afa1a04 Objects/unicodeobject.c --- a/Objects/unicodeobject.c Sat Feb 25 16:32:18 2012 +0100 +++ b/Objects/unicodeobject.c Sun Feb 26 13:59:42 2012 +0100 @@ -11080,7 +11080,7 @@ interpreted as in slice notation."); static PyObject * -unicode_count(PyObject *self, PyObject *args) +unicode_count(PyObject *self, PyObject *args, PyObject *kwds) { PyObject *substring; Py_ssize_t start = 0; @@ -11090,7 +11090,7 @@ void *buf1, *buf2; Py_ssize_t len1, len2, iresult; - if (!stringlib_parse_args_finds_unicode("count", args, &substring, + if (!stringlib_parse_args_finds_unicode("count", args, kwds, &substring, &start, &end)) return NULL; @@ -11271,14 +11271,14 @@ Return -1 on failure."); static PyObject * -unicode_find(PyObject *self, PyObject *args) +unicode_find(PyObject *self, PyObject *args, PyObject *kwds) { PyObject *substring; Py_ssize_t start; Py_ssize_t end; Py_ssize_t result; - if (!stringlib_parse_args_finds_unicode("find", args, &substring, + if (!stringlib_parse_args_finds_unicode("find", args, kwds, &substring, &start, &end)) return NULL; @@ -11372,14 +11372,14 @@ Like S.find() but raise ValueError when the substring is not found."); static PyObject * -unicode_index(PyObject *self, PyObject *args) +unicode_index(PyObject *self, PyObject *args, PyObject *kwds) { Py_ssize_t result; PyObject *substring; Py_ssize_t start; Py_ssize_t end; - if (!stringlib_parse_args_finds_unicode("index", args, &substring, + if (!stringlib_parse_args_finds_unicode("index", args, kwds, &substring, &start, &end)) return NULL; @@ -12388,14 +12388,14 @@ Return -1 on failure."); static PyObject * -unicode_rfind(PyObject *self, PyObject *args) +unicode_rfind(PyObject *self, PyObject *args, PyObject *kwds) { PyObject *substring; Py_ssize_t start; Py_ssize_t end; Py_ssize_t result; - if (!stringlib_parse_args_finds_unicode("rfind", args, &substring, + if (!stringlib_parse_args_finds_unicode("rfind", args, kwds, &substring, &start, &end)) return NULL; @@ -12420,14 +12420,14 @@ Like S.rfind() but raise ValueError when the substring is not found."); static PyObject * -unicode_rindex(PyObject *self, PyObject *args) +unicode_rindex(PyObject *self, PyObject *args, PyObject *kwds) { PyObject *substring; Py_ssize_t start; Py_ssize_t end; Py_ssize_t result; - if (!stringlib_parse_args_finds_unicode("rindex", args, &substring, + if (!stringlib_parse_args_finds_unicode("rindex", args, kwds, &substring, &start, &end)) return NULL; @@ -13000,8 +13000,7 @@ prefix can also be a tuple of strings to try."); static PyObject * -unicode_startswith(PyObject *self, - PyObject *args) +unicode_startswith(PyObject *self, PyObject *args, PyObject *kwds) { PyObject *subobj; PyObject *substring; @@ -13009,7 +13008,8 @@ Py_ssize_t end = PY_SSIZE_T_MAX; int result; - if (!stringlib_parse_args_finds("startswith", args, &subobj, &start, &end)) + if (!stringlib_parse_args_finds("startswith", args, kwds, &subobj, &start, + &end)) return NULL; if (PyTuple_Check(subobj)) { Py_ssize_t i; @@ -13048,8 +13048,7 @@ suffix can also be a tuple of strings to try."); static PyObject * -unicode_endswith(PyObject *self, - PyObject *args) +unicode_endswith(PyObject *self, PyObject *args, PyObject *kwds) { PyObject *subobj; PyObject *substring; @@ -13057,7 +13056,8 @@ Py_ssize_t end = PY_SSIZE_T_MAX; int result; - if (!stringlib_parse_args_finds("endswith", args, &subobj, &start, &end)) + if (!stringlib_parse_args_finds("endswith", args, kwds, &subobj, &start, + &end)) return NULL; if (PyTuple_Check(subobj)) { Py_ssize_t i; @@ -13174,16 +13174,16 @@ {"casefold", (PyCFunction) unicode_casefold, METH_NOARGS, casefold__doc__}, {"title", (PyCFunction) unicode_title, METH_NOARGS, title__doc__}, {"center", (PyCFunction) unicode_center, METH_VARARGS, center__doc__}, - {"count", (PyCFunction) unicode_count, METH_VARARGS, count__doc__}, + {"count", (PyCFunction) unicode_count, METH_VARARGS | METH_KEYWORDS, count__doc__}, {"expandtabs", (PyCFunction) unicode_expandtabs, METH_VARARGS, expandtabs__doc__}, - {"find", (PyCFunction) unicode_find, METH_VARARGS, find__doc__}, + {"find", (PyCFunction) unicode_find, METH_VARARGS | METH_KEYWORDS, find__doc__}, {"partition", (PyCFunction) unicode_partition, METH_O, partition__doc__}, - {"index", (PyCFunction) unicode_index, METH_VARARGS, index__doc__}, + {"index", (PyCFunction) unicode_index, METH_VARARGS | METH_KEYWORDS, index__doc__}, {"ljust", (PyCFunction) unicode_ljust, METH_VARARGS, ljust__doc__}, {"lower", (PyCFunction) unicode_lower, METH_NOARGS, lower__doc__}, {"lstrip", (PyCFunction) unicode_lstrip, METH_VARARGS, lstrip__doc__}, - {"rfind", (PyCFunction) unicode_rfind, METH_VARARGS, rfind__doc__}, - {"rindex", (PyCFunction) unicode_rindex, METH_VARARGS, rindex__doc__}, + {"rfind", (PyCFunction) unicode_rfind, METH_VARARGS | METH_KEYWORDS, rfind__doc__}, + {"rindex", (PyCFunction) unicode_rindex, METH_VARARGS | METH_KEYWORDS, rindex__doc__}, {"rjust", (PyCFunction) unicode_rjust, METH_VARARGS, rjust__doc__}, {"rstrip", (PyCFunction) unicode_rstrip, METH_VARARGS, rstrip__doc__}, {"rpartition", (PyCFunction) unicode_rpartition, METH_O, rpartition__doc__}, @@ -13192,8 +13192,8 @@ {"swapcase", (PyCFunction) unicode_swapcase, METH_NOARGS, swapcase__doc__}, {"translate", (PyCFunction) unicode_translate, METH_O, translate__doc__}, {"upper", (PyCFunction) unicode_upper, METH_NOARGS, upper__doc__}, - {"startswith", (PyCFunction) unicode_startswith, METH_VARARGS, startswith__doc__}, - {"endswith", (PyCFunction) unicode_endswith, METH_VARARGS, endswith__doc__}, + {"startswith", (PyCFunction) unicode_startswith, METH_VARARGS | METH_KEYWORDS, startswith__doc__}, + {"endswith", (PyCFunction) unicode_endswith, METH_VARARGS | METH_KEYWORDS, endswith__doc__}, {"islower", (PyCFunction) unicode_islower, METH_NOARGS, islower__doc__}, {"isupper", (PyCFunction) unicode_isupper, METH_NOARGS, isupper__doc__}, {"istitle", (PyCFunction) unicode_istitle, METH_NOARGS, istitle__doc__},