diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-01-25 13:25:52 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-01-25 13:25:52 +0200 |
commit | 3f19a274c28567afb39ba46ea8a2ebdeab816b0b (patch) | |
tree | b455925dd27f3d6e421d9fca9f3295b988a24254 /Modules/clinic/_sre.c.h | |
parent | b0cbde5d42f12b3aca11b87c017b3c60a26be4fd (diff) | |
parent | c8486579312320fd09c56ce9fce3da7ea0ffd132 (diff) | |
download | cpython-3f19a274c28567afb39ba46ea8a2ebdeab816b0b.tar.gz |
Issue #27867: Function PySlice_GetIndicesEx() is replaced with a macro if
Py_LIMITED_API is not set or set to the value between 0x03050400
and 0x03060000 (not including) or 0x03060100 or higher.
Diffstat (limited to 'Modules/clinic/_sre.c.h')
-rw-r--r-- | Modules/clinic/_sre.c.h | 206 |
1 files changed, 122 insertions, 84 deletions
diff --git a/Modules/clinic/_sre.c.h b/Modules/clinic/_sre.c.h index 3281717218..0612005d1e 100644 --- a/Modules/clinic/_sre.c.h +++ b/Modules/clinic/_sre.c.h @@ -20,8 +20,9 @@ _sre_getcodesize(PyObject *module, PyObject *Py_UNUSED(ignored)) int _return_value; _return_value = _sre_getcodesize_impl(module); - if ((_return_value == -1) && PyErr_Occurred()) + if ((_return_value == -1) && PyErr_Occurred()) { goto exit; + } return_value = PyLong_FromLong((long)_return_value); exit: @@ -48,11 +49,13 @@ _sre_getlower(PyObject *module, PyObject *args) int _return_value; if (!PyArg_ParseTuple(args, "ii:getlower", - &character, &flags)) + &character, &flags)) { goto exit; + } _return_value = _sre_getlower_impl(module, character, flags); - if ((_return_value == -1) && PyErr_Occurred()) + if ((_return_value == -1) && PyErr_Occurred()) { goto exit; + } return_value = PyLong_FromLong((long)_return_value); exit: @@ -66,7 +69,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern_match__doc__, "Matches zero or more characters at the beginning of the string."); #define _SRE_SRE_PATTERN_MATCH_METHODDEF \ - {"match", (PyCFunction)_sre_SRE_Pattern_match, METH_VARARGS|METH_KEYWORDS, _sre_SRE_Pattern_match__doc__}, + {"match", (PyCFunction)_sre_SRE_Pattern_match, METH_FASTCALL, _sre_SRE_Pattern_match__doc__}, static PyObject * _sre_SRE_Pattern_match_impl(PatternObject *self, PyObject *string, @@ -74,18 +77,20 @@ _sre_SRE_Pattern_match_impl(PatternObject *self, PyObject *string, PyObject *pattern); static PyObject * -_sre_SRE_Pattern_match(PatternObject *self, PyObject *args, PyObject *kwargs) +_sre_SRE_Pattern_match(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"string", "pos", "endpos", "pattern", NULL}; + static const char * const _keywords[] = {"string", "pos", "endpos", "pattern", NULL}; + static _PyArg_Parser _parser = {"|Onn$O:match", _keywords, 0}; PyObject *string = NULL; Py_ssize_t pos = 0; Py_ssize_t endpos = PY_SSIZE_T_MAX; PyObject *pattern = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|Onn$O:match", _keywords, - &string, &pos, &endpos, &pattern)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &string, &pos, &endpos, &pattern)) { goto exit; + } return_value = _sre_SRE_Pattern_match_impl(self, string, pos, endpos, pattern); exit: @@ -100,7 +105,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern_fullmatch__doc__, "Matches against all of the string"); #define _SRE_SRE_PATTERN_FULLMATCH_METHODDEF \ - {"fullmatch", (PyCFunction)_sre_SRE_Pattern_fullmatch, METH_VARARGS|METH_KEYWORDS, _sre_SRE_Pattern_fullmatch__doc__}, + {"fullmatch", (PyCFunction)_sre_SRE_Pattern_fullmatch, METH_FASTCALL, _sre_SRE_Pattern_fullmatch__doc__}, static PyObject * _sre_SRE_Pattern_fullmatch_impl(PatternObject *self, PyObject *string, @@ -108,18 +113,20 @@ _sre_SRE_Pattern_fullmatch_impl(PatternObject *self, PyObject *string, PyObject *pattern); static PyObject * -_sre_SRE_Pattern_fullmatch(PatternObject *self, PyObject *args, PyObject *kwargs) +_sre_SRE_Pattern_fullmatch(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"string", "pos", "endpos", "pattern", NULL}; + static const char * const _keywords[] = {"string", "pos", "endpos", "pattern", NULL}; + static _PyArg_Parser _parser = {"|Onn$O:fullmatch", _keywords, 0}; PyObject *string = NULL; Py_ssize_t pos = 0; Py_ssize_t endpos = PY_SSIZE_T_MAX; PyObject *pattern = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|Onn$O:fullmatch", _keywords, - &string, &pos, &endpos, &pattern)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &string, &pos, &endpos, &pattern)) { goto exit; + } return_value = _sre_SRE_Pattern_fullmatch_impl(self, string, pos, endpos, pattern); exit: @@ -136,7 +143,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern_search__doc__, "Return None if no position in the string matches."); #define _SRE_SRE_PATTERN_SEARCH_METHODDEF \ - {"search", (PyCFunction)_sre_SRE_Pattern_search, METH_VARARGS|METH_KEYWORDS, _sre_SRE_Pattern_search__doc__}, + {"search", (PyCFunction)_sre_SRE_Pattern_search, METH_FASTCALL, _sre_SRE_Pattern_search__doc__}, static PyObject * _sre_SRE_Pattern_search_impl(PatternObject *self, PyObject *string, @@ -144,18 +151,20 @@ _sre_SRE_Pattern_search_impl(PatternObject *self, PyObject *string, PyObject *pattern); static PyObject * -_sre_SRE_Pattern_search(PatternObject *self, PyObject *args, PyObject *kwargs) +_sre_SRE_Pattern_search(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"string", "pos", "endpos", "pattern", NULL}; + static const char * const _keywords[] = {"string", "pos", "endpos", "pattern", NULL}; + static _PyArg_Parser _parser = {"|Onn$O:search", _keywords, 0}; PyObject *string = NULL; Py_ssize_t pos = 0; Py_ssize_t endpos = PY_SSIZE_T_MAX; PyObject *pattern = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|Onn$O:search", _keywords, - &string, &pos, &endpos, &pattern)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &string, &pos, &endpos, &pattern)) { goto exit; + } return_value = _sre_SRE_Pattern_search_impl(self, string, pos, endpos, pattern); exit: @@ -170,7 +179,7 @@ PyDoc_STRVAR(_sre_SRE_Pattern_findall__doc__, "Return a list of all non-overlapping matches of pattern in string."); #define _SRE_SRE_PATTERN_FINDALL_METHODDEF \ - {"findall", (PyCFunction)_sre_SRE_Pattern_findall, METH_VARARGS|METH_KEYWORDS, _sre_SRE_Pattern_findall__doc__}, + {"findall", (PyCFunction)_sre_SRE_Pattern_findall, METH_FASTCALL, _sre_SRE_Pattern_findall__doc__}, static PyObject * _sre_SRE_Pattern_findall_impl(PatternObject *self, PyObject *string, @@ -178,18 +187,20 @@ _sre_SRE_Pattern_findall_impl(PatternObject *self, PyObject *string, PyObject *source); static PyObject * -_sre_SRE_Pattern_findall(PatternObject *self, PyObject *args, PyObject *kwargs) +_sre_SRE_Pattern_findall(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"string", "pos", "endpos", "source", NULL}; + static const char * const _keywords[] = {"string", "pos", "endpos", "source", NULL}; + static _PyArg_Parser _parser = {"|Onn$O:findall", _keywords, 0}; PyObject *string = NULL; Py_ssize_t pos = 0; Py_ssize_t endpos = PY_SSIZE_T_MAX; PyObject *source = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|Onn$O:findall", _keywords, - &string, &pos, &endpos, &source)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &string, &pos, &endpos, &source)) { goto exit; + } return_value = _sre_SRE_Pattern_findall_impl(self, string, pos, endpos, source); exit: @@ -205,24 +216,26 @@ PyDoc_STRVAR(_sre_SRE_Pattern_finditer__doc__, "For each match, the iterator returns a match object."); #define _SRE_SRE_PATTERN_FINDITER_METHODDEF \ - {"finditer", (PyCFunction)_sre_SRE_Pattern_finditer, METH_VARARGS|METH_KEYWORDS, _sre_SRE_Pattern_finditer__doc__}, + {"finditer", (PyCFunction)_sre_SRE_Pattern_finditer, METH_FASTCALL, _sre_SRE_Pattern_finditer__doc__}, static PyObject * _sre_SRE_Pattern_finditer_impl(PatternObject *self, PyObject *string, Py_ssize_t pos, Py_ssize_t endpos); static PyObject * -_sre_SRE_Pattern_finditer(PatternObject *self, PyObject *args, PyObject *kwargs) +_sre_SRE_Pattern_finditer(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"string", "pos", "endpos", NULL}; + static const char * const _keywords[] = {"string", "pos", "endpos", NULL}; + static _PyArg_Parser _parser = {"O|nn:finditer", _keywords, 0}; PyObject *string; Py_ssize_t pos = 0; Py_ssize_t endpos = PY_SSIZE_T_MAX; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|nn:finditer", _keywords, - &string, &pos, &endpos)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &string, &pos, &endpos)) { goto exit; + } return_value = _sre_SRE_Pattern_finditer_impl(self, string, pos, endpos); exit: @@ -235,24 +248,26 @@ PyDoc_STRVAR(_sre_SRE_Pattern_scanner__doc__, "\n"); #define _SRE_SRE_PATTERN_SCANNER_METHODDEF \ - {"scanner", (PyCFunction)_sre_SRE_Pattern_scanner, METH_VARARGS|METH_KEYWORDS, _sre_SRE_Pattern_scanner__doc__}, + {"scanner", (PyCFunction)_sre_SRE_Pattern_scanner, METH_FASTCALL, _sre_SRE_Pattern_scanner__doc__}, static PyObject * _sre_SRE_Pattern_scanner_impl(PatternObject *self, PyObject *string, Py_ssize_t pos, Py_ssize_t endpos); static PyObject * -_sre_SRE_Pattern_scanner(PatternObject *self, PyObject *args, PyObject *kwargs) +_sre_SRE_Pattern_scanner(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"string", "pos", "endpos", NULL}; + static const char * const _keywords[] = {"string", "pos", "endpos", NULL}; + static _PyArg_Parser _parser = {"O|nn:scanner", _keywords, 0}; PyObject *string; Py_ssize_t pos = 0; Py_ssize_t endpos = PY_SSIZE_T_MAX; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|nn:scanner", _keywords, - &string, &pos, &endpos)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &string, &pos, &endpos)) { goto exit; + } return_value = _sre_SRE_Pattern_scanner_impl(self, string, pos, endpos); exit: @@ -266,24 +281,26 @@ PyDoc_STRVAR(_sre_SRE_Pattern_split__doc__, "Split string by the occurrences of pattern."); #define _SRE_SRE_PATTERN_SPLIT_METHODDEF \ - {"split", (PyCFunction)_sre_SRE_Pattern_split, METH_VARARGS|METH_KEYWORDS, _sre_SRE_Pattern_split__doc__}, + {"split", (PyCFunction)_sre_SRE_Pattern_split, METH_FASTCALL, _sre_SRE_Pattern_split__doc__}, static PyObject * _sre_SRE_Pattern_split_impl(PatternObject *self, PyObject *string, Py_ssize_t maxsplit, PyObject *source); static PyObject * -_sre_SRE_Pattern_split(PatternObject *self, PyObject *args, PyObject *kwargs) +_sre_SRE_Pattern_split(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"string", "maxsplit", "source", NULL}; + static const char * const _keywords[] = {"string", "maxsplit", "source", NULL}; + static _PyArg_Parser _parser = {"|On$O:split", _keywords, 0}; PyObject *string = NULL; Py_ssize_t maxsplit = 0; PyObject *source = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|On$O:split", _keywords, - &string, &maxsplit, &source)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &string, &maxsplit, &source)) { goto exit; + } return_value = _sre_SRE_Pattern_split_impl(self, string, maxsplit, source); exit: @@ -297,24 +314,26 @@ PyDoc_STRVAR(_sre_SRE_Pattern_sub__doc__, "Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl."); #define _SRE_SRE_PATTERN_SUB_METHODDEF \ - {"sub", (PyCFunction)_sre_SRE_Pattern_sub, METH_VARARGS|METH_KEYWORDS, _sre_SRE_Pattern_sub__doc__}, + {"sub", (PyCFunction)_sre_SRE_Pattern_sub, METH_FASTCALL, _sre_SRE_Pattern_sub__doc__}, static PyObject * _sre_SRE_Pattern_sub_impl(PatternObject *self, PyObject *repl, PyObject *string, Py_ssize_t count); static PyObject * -_sre_SRE_Pattern_sub(PatternObject *self, PyObject *args, PyObject *kwargs) +_sre_SRE_Pattern_sub(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"repl", "string", "count", NULL}; + static const char * const _keywords[] = {"repl", "string", "count", NULL}; + static _PyArg_Parser _parser = {"OO|n:sub", _keywords, 0}; PyObject *repl; PyObject *string; Py_ssize_t count = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|n:sub", _keywords, - &repl, &string, &count)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &repl, &string, &count)) { goto exit; + } return_value = _sre_SRE_Pattern_sub_impl(self, repl, string, count); exit: @@ -328,24 +347,26 @@ PyDoc_STRVAR(_sre_SRE_Pattern_subn__doc__, "Return the tuple (new_string, number_of_subs_made) found by replacing the leftmost non-overlapping occurrences of pattern with the replacement repl."); #define _SRE_SRE_PATTERN_SUBN_METHODDEF \ - {"subn", (PyCFunction)_sre_SRE_Pattern_subn, METH_VARARGS|METH_KEYWORDS, _sre_SRE_Pattern_subn__doc__}, + {"subn", (PyCFunction)_sre_SRE_Pattern_subn, METH_FASTCALL, _sre_SRE_Pattern_subn__doc__}, static PyObject * _sre_SRE_Pattern_subn_impl(PatternObject *self, PyObject *repl, PyObject *string, Py_ssize_t count); static PyObject * -_sre_SRE_Pattern_subn(PatternObject *self, PyObject *args, PyObject *kwargs) +_sre_SRE_Pattern_subn(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"repl", "string", "count", NULL}; + static const char * const _keywords[] = {"repl", "string", "count", NULL}; + static _PyArg_Parser _parser = {"OO|n:subn", _keywords, 0}; PyObject *repl; PyObject *string; Py_ssize_t count = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|n:subn", _keywords, - &repl, &string, &count)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &repl, &string, &count)) { goto exit; + } return_value = _sre_SRE_Pattern_subn_impl(self, repl, string, count); exit: @@ -375,21 +396,23 @@ PyDoc_STRVAR(_sre_SRE_Pattern___deepcopy____doc__, "\n"); #define _SRE_SRE_PATTERN___DEEPCOPY___METHODDEF \ - {"__deepcopy__", (PyCFunction)_sre_SRE_Pattern___deepcopy__, METH_VARARGS|METH_KEYWORDS, _sre_SRE_Pattern___deepcopy____doc__}, + {"__deepcopy__", (PyCFunction)_sre_SRE_Pattern___deepcopy__, METH_FASTCALL, _sre_SRE_Pattern___deepcopy____doc__}, static PyObject * _sre_SRE_Pattern___deepcopy___impl(PatternObject *self, PyObject *memo); static PyObject * -_sre_SRE_Pattern___deepcopy__(PatternObject *self, PyObject *args, PyObject *kwargs) +_sre_SRE_Pattern___deepcopy__(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"memo", NULL}; + static const char * const _keywords[] = {"memo", NULL}; + static _PyArg_Parser _parser = {"O:__deepcopy__", _keywords, 0}; PyObject *memo; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:__deepcopy__", _keywords, - &memo)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &memo)) { goto exit; + } return_value = _sre_SRE_Pattern___deepcopy___impl(self, memo); exit: @@ -403,7 +426,7 @@ PyDoc_STRVAR(_sre_compile__doc__, "\n"); #define _SRE_COMPILE_METHODDEF \ - {"compile", (PyCFunction)_sre_compile, METH_VARARGS|METH_KEYWORDS, _sre_compile__doc__}, + {"compile", (PyCFunction)_sre_compile, METH_FASTCALL, _sre_compile__doc__}, static PyObject * _sre_compile_impl(PyObject *module, PyObject *pattern, int flags, @@ -411,10 +434,11 @@ _sre_compile_impl(PyObject *module, PyObject *pattern, int flags, PyObject *indexgroup); static PyObject * -_sre_compile(PyObject *module, PyObject *args, PyObject *kwargs) +_sre_compile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"pattern", "flags", "code", "groups", "groupindex", "indexgroup", NULL}; + static const char * const _keywords[] = {"pattern", "flags", "code", "groups", "groupindex", "indexgroup", NULL}; + static _PyArg_Parser _parser = {"OiO!nOO:compile", _keywords, 0}; PyObject *pattern; int flags; PyObject *code; @@ -422,9 +446,10 @@ _sre_compile(PyObject *module, PyObject *args, PyObject *kwargs) PyObject *groupindex; PyObject *indexgroup; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO!nOO:compile", _keywords, - &pattern, &flags, &PyList_Type, &code, &groups, &groupindex, &indexgroup)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &pattern, &flags, &PyList_Type, &code, &groups, &groupindex, &indexgroup)) { goto exit; + } return_value = _sre_compile_impl(module, pattern, flags, code, groups, groupindex, indexgroup); exit: @@ -438,21 +463,23 @@ PyDoc_STRVAR(_sre_SRE_Match_expand__doc__, "Return the string obtained by doing backslash substitution on the string template, as done by the sub() method."); #define _SRE_SRE_MATCH_EXPAND_METHODDEF \ - {"expand", (PyCFunction)_sre_SRE_Match_expand, METH_VARARGS|METH_KEYWORDS, _sre_SRE_Match_expand__doc__}, + {"expand", (PyCFunction)_sre_SRE_Match_expand, METH_FASTCALL, _sre_SRE_Match_expand__doc__}, static PyObject * _sre_SRE_Match_expand_impl(MatchObject *self, PyObject *template); static PyObject * -_sre_SRE_Match_expand(MatchObject *self, PyObject *args, PyObject *kwargs) +_sre_SRE_Match_expand(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"template", NULL}; + static const char * const _keywords[] = {"template", NULL}; + static _PyArg_Parser _parser = {"O:expand", _keywords, 0}; PyObject *template; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:expand", _keywords, - &template)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &template)) { goto exit; + } return_value = _sre_SRE_Match_expand_impl(self, template); exit: @@ -469,21 +496,23 @@ PyDoc_STRVAR(_sre_SRE_Match_groups__doc__, " Is used for groups that did not participate in the match."); #define _SRE_SRE_MATCH_GROUPS_METHODDEF \ - {"groups", (PyCFunction)_sre_SRE_Match_groups, METH_VARARGS|METH_KEYWORDS, _sre_SRE_Match_groups__doc__}, + {"groups", (PyCFunction)_sre_SRE_Match_groups, METH_FASTCALL, _sre_SRE_Match_groups__doc__}, static PyObject * _sre_SRE_Match_groups_impl(MatchObject *self, PyObject *default_value); static PyObject * -_sre_SRE_Match_groups(MatchObject *self, PyObject *args, PyObject *kwargs) +_sre_SRE_Match_groups(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"default", NULL}; + static const char * const _keywords[] = {"default", NULL}; + static _PyArg_Parser _parser = {"|O:groups", _keywords, 0}; PyObject *default_value = Py_None; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:groups", _keywords, - &default_value)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &default_value)) { goto exit; + } return_value = _sre_SRE_Match_groups_impl(self, default_value); exit: @@ -500,21 +529,23 @@ PyDoc_STRVAR(_sre_SRE_Match_groupdict__doc__, " Is used for groups that did not participate in the match."); #define _SRE_SRE_MATCH_GROUPDICT_METHODDEF \ - {"groupdict", (PyCFunction)_sre_SRE_Match_groupdict, METH_VARARGS|METH_KEYWORDS, _sre_SRE_Match_groupdict__doc__}, + {"groupdict", (PyCFunction)_sre_SRE_Match_groupdict, METH_FASTCALL, _sre_SRE_Match_groupdict__doc__}, static PyObject * _sre_SRE_Match_groupdict_impl(MatchObject *self, PyObject *default_value); static PyObject * -_sre_SRE_Match_groupdict(MatchObject *self, PyObject *args, PyObject *kwargs) +_sre_SRE_Match_groupdict(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"default", NULL}; + static const char * const _keywords[] = {"default", NULL}; + static _PyArg_Parser _parser = {"|O:groupdict", _keywords, 0}; PyObject *default_value = Py_None; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:groupdict", _keywords, - &default_value)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &default_value)) { goto exit; + } return_value = _sre_SRE_Match_groupdict_impl(self, default_value); exit: @@ -542,11 +573,13 @@ _sre_SRE_Match_start(MatchObject *self, PyObject *args) if (!PyArg_UnpackTuple(args, "start", 0, 1, - &group)) + &group)) { goto exit; + } _return_value = _sre_SRE_Match_start_impl(self, group); - if ((_return_value == -1) && PyErr_Occurred()) + if ((_return_value == -1) && PyErr_Occurred()) { goto exit; + } return_value = PyLong_FromSsize_t(_return_value); exit: @@ -574,11 +607,13 @@ _sre_SRE_Match_end(MatchObject *self, PyObject *args) if (!PyArg_UnpackTuple(args, "end", 0, 1, - &group)) + &group)) { goto exit; + } _return_value = _sre_SRE_Match_end_impl(self, group); - if ((_return_value == -1) && PyErr_Occurred()) + if ((_return_value == -1) && PyErr_Occurred()) { goto exit; + } return_value = PyLong_FromSsize_t(_return_value); exit: @@ -605,8 +640,9 @@ _sre_SRE_Match_span(MatchObject *self, PyObject *args) if (!PyArg_UnpackTuple(args, "span", 0, 1, - &group)) + &group)) { goto exit; + } return_value = _sre_SRE_Match_span_impl(self, group); exit: @@ -636,21 +672,23 @@ PyDoc_STRVAR(_sre_SRE_Match___deepcopy____doc__, "\n"); #define _SRE_SRE_MATCH___DEEPCOPY___METHODDEF \ - {"__deepcopy__", (PyCFunction)_sre_SRE_Match___deepcopy__, METH_VARARGS|METH_KEYWORDS, _sre_SRE_Match___deepcopy____doc__}, + {"__deepcopy__", (PyCFunction)_sre_SRE_Match___deepcopy__, METH_FASTCALL, _sre_SRE_Match___deepcopy____doc__}, static PyObject * _sre_SRE_Match___deepcopy___impl(MatchObject *self, PyObject *memo); static PyObject * -_sre_SRE_Match___deepcopy__(MatchObject *self, PyObject *args, PyObject *kwargs) +_sre_SRE_Match___deepcopy__(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"memo", NULL}; + static const char * const _keywords[] = {"memo", NULL}; + static _PyArg_Parser _parser = {"O:__deepcopy__", _keywords, 0}; PyObject *memo; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:__deepcopy__", _keywords, - &memo)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &memo)) { goto exit; + } return_value = _sre_SRE_Match___deepcopy___impl(self, memo); exit: @@ -690,4 +728,4 @@ _sre_SRE_Scanner_search(ScannerObject *self, PyObject *Py_UNUSED(ignored)) { return _sre_SRE_Scanner_search_impl(self); } -/*[clinic end generated code: output=a4ce9e5b748ce532 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a4a246bca1963bc9 input=a9049054013a1b77]*/ |