summaryrefslogtreecommitdiffstats
path: root/Modules/_sre
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend.aasland@protonmail.com>2022-08-13 10:09:40 (GMT)
committerGitHub <noreply@github.com>2022-08-13 10:09:40 (GMT)
commitf07adf82f338ebb7e69475537be050e63c2009fa (patch)
tree26c4cd000b95fc45befb2ea3c87c03d84d9aed75 /Modules/_sre
parentf235178beccf5eb5b47e770240f32d9ba24b26fd (diff)
downloadcpython-f07adf82f338ebb7e69475537be050e63c2009fa.zip
cpython-f07adf82f338ebb7e69475537be050e63c2009fa.tar.gz
cpython-f07adf82f338ebb7e69475537be050e63c2009fa.tar.bz2
gh-90928: Improve static initialization of keywords tuple in AC (#95907)
Diffstat (limited to 'Modules/_sre')
-rw-r--r--Modules/_sre/clinic/sre.c.h314
1 files changed, 92 insertions, 222 deletions
diff --git a/Modules/_sre/clinic/sre.c.h b/Modules/_sre/clinic/sre.c.h
index dc5c6c1..711e16a 100644
--- a/Modules/_sre/clinic/sre.c.h
+++ b/Modules/_sre/clinic/sre.c.h
@@ -181,18 +181,9 @@ static PyObject *
_sre_SRE_Pattern_match(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- #define NUM_KEYWORDS 3
- #if NUM_KEYWORDS == 0
-
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
- # else
- # define KWTUPLE NULL
- # endif
-
- #else // NUM_KEYWORDS != 0
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #define NUM_KEYWORDS 3
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
@@ -201,13 +192,12 @@ _sre_SRE_Pattern_match(PatternObject *self, PyTypeObject *cls, PyObject *const *
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
.ob_item = { &_Py_ID(string), &_Py_ID(pos), &_Py_ID(endpos), },
};
- # define KWTUPLE (&_kwtuple.ob_base.ob_base)
-
- # else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- # endif // !Py_BUILD_CORE
- #endif // NUM_KEYWORDS != 0
#undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
static _PyArg_Parser _parser = {
@@ -284,18 +274,9 @@ static PyObject *
_sre_SRE_Pattern_fullmatch(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- #define NUM_KEYWORDS 3
- #if NUM_KEYWORDS == 0
-
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
- # else
- # define KWTUPLE NULL
- # endif
-
- #else // NUM_KEYWORDS != 0
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #define NUM_KEYWORDS 3
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
@@ -304,13 +285,12 @@ _sre_SRE_Pattern_fullmatch(PatternObject *self, PyTypeObject *cls, PyObject *con
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
.ob_item = { &_Py_ID(string), &_Py_ID(pos), &_Py_ID(endpos), },
};
- # define KWTUPLE (&_kwtuple.ob_base.ob_base)
-
- # else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- # endif // !Py_BUILD_CORE
- #endif // NUM_KEYWORDS != 0
#undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
static _PyArg_Parser _parser = {
@@ -389,18 +369,9 @@ static PyObject *
_sre_SRE_Pattern_search(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- #define NUM_KEYWORDS 3
- #if NUM_KEYWORDS == 0
-
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
- # else
- # define KWTUPLE NULL
- # endif
-
- #else // NUM_KEYWORDS != 0
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #define NUM_KEYWORDS 3
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
@@ -409,13 +380,12 @@ _sre_SRE_Pattern_search(PatternObject *self, PyTypeObject *cls, PyObject *const
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
.ob_item = { &_Py_ID(string), &_Py_ID(pos), &_Py_ID(endpos), },
};
- # define KWTUPLE (&_kwtuple.ob_base.ob_base)
-
- # else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- # endif // !Py_BUILD_CORE
- #endif // NUM_KEYWORDS != 0
#undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
static _PyArg_Parser _parser = {
@@ -491,18 +461,9 @@ static PyObject *
_sre_SRE_Pattern_findall(PatternObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- #define NUM_KEYWORDS 3
- #if NUM_KEYWORDS == 0
-
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
- # else
- # define KWTUPLE NULL
- # endif
-
- #else // NUM_KEYWORDS != 0
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #define NUM_KEYWORDS 3
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
@@ -511,13 +472,12 @@ _sre_SRE_Pattern_findall(PatternObject *self, PyObject *const *args, Py_ssize_t
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
.ob_item = { &_Py_ID(string), &_Py_ID(pos), &_Py_ID(endpos), },
};
- # define KWTUPLE (&_kwtuple.ob_base.ob_base)
-
- # else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- # endif // !Py_BUILD_CORE
- #endif // NUM_KEYWORDS != 0
#undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
static _PyArg_Parser _parser = {
@@ -596,18 +556,9 @@ static PyObject *
_sre_SRE_Pattern_finditer(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- #define NUM_KEYWORDS 3
- #if NUM_KEYWORDS == 0
-
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
- # else
- # define KWTUPLE NULL
- # endif
-
- #else // NUM_KEYWORDS != 0
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #define NUM_KEYWORDS 3
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
@@ -616,13 +567,12 @@ _sre_SRE_Pattern_finditer(PatternObject *self, PyTypeObject *cls, PyObject *cons
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
.ob_item = { &_Py_ID(string), &_Py_ID(pos), &_Py_ID(endpos), },
};
- # define KWTUPLE (&_kwtuple.ob_base.ob_base)
-
- # else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- # endif // !Py_BUILD_CORE
- #endif // NUM_KEYWORDS != 0
#undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
static _PyArg_Parser _parser = {
@@ -698,18 +648,9 @@ static PyObject *
_sre_SRE_Pattern_scanner(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- #define NUM_KEYWORDS 3
- #if NUM_KEYWORDS == 0
-
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
- # else
- # define KWTUPLE NULL
- # endif
-
- #else // NUM_KEYWORDS != 0
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #define NUM_KEYWORDS 3
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
@@ -718,13 +659,12 @@ _sre_SRE_Pattern_scanner(PatternObject *self, PyTypeObject *cls, PyObject *const
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
.ob_item = { &_Py_ID(string), &_Py_ID(pos), &_Py_ID(endpos), },
};
- # define KWTUPLE (&_kwtuple.ob_base.ob_base)
-
- # else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- # endif // !Py_BUILD_CORE
- #endif // NUM_KEYWORDS != 0
#undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
static _PyArg_Parser _parser = {
@@ -800,18 +740,9 @@ static PyObject *
_sre_SRE_Pattern_split(PatternObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- #define NUM_KEYWORDS 2
- #if NUM_KEYWORDS == 0
-
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
- # else
- # define KWTUPLE NULL
- # endif
-
- #else // NUM_KEYWORDS != 0
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #define NUM_KEYWORDS 2
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
@@ -820,13 +751,12 @@ _sre_SRE_Pattern_split(PatternObject *self, PyObject *const *args, Py_ssize_t na
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
.ob_item = { &_Py_ID(string), &_Py_ID(maxsplit), },
};
- # define KWTUPLE (&_kwtuple.ob_base.ob_base)
-
- # else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- # endif // !Py_BUILD_CORE
- #endif // NUM_KEYWORDS != 0
#undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
static const char * const _keywords[] = {"string", "maxsplit", NULL};
static _PyArg_Parser _parser = {
@@ -884,18 +814,9 @@ static PyObject *
_sre_SRE_Pattern_sub(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- #define NUM_KEYWORDS 3
- #if NUM_KEYWORDS == 0
-
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
- # else
- # define KWTUPLE NULL
- # endif
-
- #else // NUM_KEYWORDS != 0
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #define NUM_KEYWORDS 3
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
@@ -904,13 +825,12 @@ _sre_SRE_Pattern_sub(PatternObject *self, PyTypeObject *cls, PyObject *const *ar
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
.ob_item = { &_Py_ID(repl), &_Py_ID(string), &_Py_ID(count), },
};
- # define KWTUPLE (&_kwtuple.ob_base.ob_base)
-
- # else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- # endif // !Py_BUILD_CORE
- #endif // NUM_KEYWORDS != 0
#undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
static const char * const _keywords[] = {"repl", "string", "count", NULL};
static _PyArg_Parser _parser = {
@@ -971,18 +891,9 @@ static PyObject *
_sre_SRE_Pattern_subn(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- #define NUM_KEYWORDS 3
- #if NUM_KEYWORDS == 0
-
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
- # else
- # define KWTUPLE NULL
- # endif
-
- #else // NUM_KEYWORDS != 0
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #define NUM_KEYWORDS 3
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
@@ -991,13 +902,12 @@ _sre_SRE_Pattern_subn(PatternObject *self, PyTypeObject *cls, PyObject *const *a
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
.ob_item = { &_Py_ID(repl), &_Py_ID(string), &_Py_ID(count), },
};
- # define KWTUPLE (&_kwtuple.ob_base.ob_base)
-
- # else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- # endif // !Py_BUILD_CORE
- #endif // NUM_KEYWORDS != 0
#undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
static const char * const _keywords[] = {"repl", "string", "count", NULL};
static _PyArg_Parser _parser = {
@@ -1083,18 +993,9 @@ static PyObject *
_sre_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- #define NUM_KEYWORDS 6
- #if NUM_KEYWORDS == 0
-
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
- # else
- # define KWTUPLE NULL
- # endif
-
- #else // NUM_KEYWORDS != 0
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #define NUM_KEYWORDS 6
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
@@ -1103,13 +1004,12 @@ _sre_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
.ob_item = { &_Py_ID(pattern), &_Py_ID(flags), &_Py_ID(code), &_Py_ID(groups), &_Py_ID(groupindex), &_Py_ID(indexgroup), },
};
- # define KWTUPLE (&_kwtuple.ob_base.ob_base)
-
- # else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- # endif // !Py_BUILD_CORE
- #endif // NUM_KEYWORDS != 0
#undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
static const char * const _keywords[] = {"pattern", "flags", "code", "groups", "groupindex", "indexgroup", NULL};
static _PyArg_Parser _parser = {
@@ -1184,18 +1084,9 @@ static PyObject *
_sre_SRE_Match_expand(MatchObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- #define NUM_KEYWORDS 1
- #if NUM_KEYWORDS == 0
-
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
- # else
- # define KWTUPLE NULL
- # endif
-
- #else // NUM_KEYWORDS != 0
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #define NUM_KEYWORDS 1
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
@@ -1204,13 +1095,12 @@ _sre_SRE_Match_expand(MatchObject *self, PyObject *const *args, Py_ssize_t nargs
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
.ob_item = { &_Py_ID(template), },
};
- # define KWTUPLE (&_kwtuple.ob_base.ob_base)
-
- # else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- # endif // !Py_BUILD_CORE
- #endif // NUM_KEYWORDS != 0
#undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
static const char * const _keywords[] = {"template", NULL};
static _PyArg_Parser _parser = {
@@ -1252,18 +1142,9 @@ static PyObject *
_sre_SRE_Match_groups(MatchObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- #define NUM_KEYWORDS 1
- #if NUM_KEYWORDS == 0
-
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
- # else
- # define KWTUPLE NULL
- # endif
-
- #else // NUM_KEYWORDS != 0
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #define NUM_KEYWORDS 1
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
@@ -1272,13 +1153,12 @@ _sre_SRE_Match_groups(MatchObject *self, PyObject *const *args, Py_ssize_t nargs
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
.ob_item = { &_Py_ID(default), },
};
- # define KWTUPLE (&_kwtuple.ob_base.ob_base)
-
- # else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- # endif // !Py_BUILD_CORE
- #endif // NUM_KEYWORDS != 0
#undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
static const char * const _keywords[] = {"default", NULL};
static _PyArg_Parser _parser = {
@@ -1325,18 +1205,9 @@ static PyObject *
_sre_SRE_Match_groupdict(MatchObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- #define NUM_KEYWORDS 1
- #if NUM_KEYWORDS == 0
-
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
- # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
- # else
- # define KWTUPLE NULL
- # endif
-
- #else // NUM_KEYWORDS != 0
- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ #define NUM_KEYWORDS 1
static struct {
PyGC_Head _this_is_not_used;
PyObject_VAR_HEAD
@@ -1345,13 +1216,12 @@ _sre_SRE_Match_groupdict(MatchObject *self, PyObject *const *args, Py_ssize_t na
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
.ob_item = { &_Py_ID(default), },
};
- # define KWTUPLE (&_kwtuple.ob_base.ob_base)
-
- # else // !Py_BUILD_CORE
- # define KWTUPLE NULL
- # endif // !Py_BUILD_CORE
- #endif // NUM_KEYWORDS != 0
#undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
static const char * const _keywords[] = {"default", NULL};
static _PyArg_Parser _parser = {
@@ -1551,4 +1421,4 @@ _sre_SRE_Scanner_search(ScannerObject *self, PyTypeObject *cls, PyObject *const
}
return _sre_SRE_Scanner_search_impl(self, cls);
}
-/*[clinic end generated code: output=d686111c67a7d0aa input=a9049054013a1b77]*/
+/*[clinic end generated code: output=14ea86f85c130a7b input=a9049054013a1b77]*/