mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +00:00
gh-90928: Improve static initialization of keywords tuple in AC (#95907)
This commit is contained in:
parent
f235178bec
commit
f07adf82f3
81 changed files with 2746 additions and 6797 deletions
26
Python/clinic/Python-tokenize.c.h
generated
26
Python/clinic/Python-tokenize.c.h
generated
|
@ -15,18 +15,9 @@ static PyObject *
|
|||
tokenizeriter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
|
||||
|
||||
#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)
|
||||
|
||||
static struct {
|
||||
PyGC_Head _this_is_not_used;
|
||||
PyObject_VAR_HEAD
|
||||
|
@ -35,13 +26,12 @@ tokenizeriter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
|
|||
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
|
||||
.ob_item = { &_Py_ID(source), },
|
||||
};
|
||||
# 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[] = {"source", NULL};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -77,4 +67,4 @@ tokenizeriter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=5664c98597aec79e input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=8c2c09f651961986 input=a9049054013a1b77]*/
|
||||
|
|
50
Python/clinic/_warnings.c.h
generated
50
Python/clinic/_warnings.c.h
generated
|
@ -25,18 +25,9 @@ static PyObject *
|
|||
warnings_warn(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
|
||||
|
||||
#define NUM_KEYWORDS 4
|
||||
#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)
|
||||
|
||||
static struct {
|
||||
PyGC_Head _this_is_not_used;
|
||||
PyObject_VAR_HEAD
|
||||
|
@ -45,13 +36,12 @@ warnings_warn(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec
|
|||
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
|
||||
.ob_item = { &_Py_ID(message), &_Py_ID(category), &_Py_ID(stacklevel), &_Py_ID(source), },
|
||||
};
|
||||
# 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[] = {"message", "category", "stacklevel", "source", NULL};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -127,18 +117,9 @@ static PyObject *
|
|||
warnings_warn_explicit(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
|
||||
|
||||
#define NUM_KEYWORDS 8
|
||||
#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)
|
||||
|
||||
static struct {
|
||||
PyGC_Head _this_is_not_used;
|
||||
PyObject_VAR_HEAD
|
||||
|
@ -147,13 +128,12 @@ warnings_warn_explicit(PyObject *module, PyObject *const *args, Py_ssize_t nargs
|
|||
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
|
||||
.ob_item = { &_Py_ID(message), &_Py_ID(category), &_Py_ID(filename), &_Py_ID(lineno), &_Py_ID(module), &_Py_ID(registry), &_Py_ID(module_globals), &_Py_ID(source), },
|
||||
};
|
||||
# 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[] = {"message", "category", "filename", "lineno", "module", "registry", "module_globals", "source", NULL};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -219,4 +199,4 @@ skip_optional_pos:
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=264258fa6b1b0c36 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=2eac4fabc87a4d56 input=a9049054013a1b77]*/
|
||||
|
|
170
Python/clinic/bltinmodule.c.h
generated
170
Python/clinic/bltinmodule.c.h
generated
|
@ -40,18 +40,9 @@ static PyObject *
|
|||
builtin___import__(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
|
||||
|
||||
#define NUM_KEYWORDS 5
|
||||
#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)
|
||||
|
||||
static struct {
|
||||
PyGC_Head _this_is_not_used;
|
||||
PyObject_VAR_HEAD
|
||||
|
@ -60,13 +51,12 @@ builtin___import__(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py
|
|||
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
|
||||
.ob_item = { &_Py_ID(name), &_Py_ID(globals), &_Py_ID(locals), &_Py_ID(fromlist), &_Py_ID(level), },
|
||||
};
|
||||
# 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[] = {"name", "globals", "locals", "fromlist", "level", NULL};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -292,18 +282,9 @@ static PyObject *
|
|||
builtin_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
|
||||
|
||||
#define NUM_KEYWORDS 7
|
||||
#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)
|
||||
|
||||
static struct {
|
||||
PyGC_Head _this_is_not_used;
|
||||
PyObject_VAR_HEAD
|
||||
|
@ -312,13 +293,12 @@ builtin_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj
|
|||
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
|
||||
.ob_item = { &_Py_ID(source), &_Py_ID(filename), &_Py_ID(mode), &_Py_ID(flags), &_Py_ID(dont_inherit), &_Py_ID(optimize), &_Py_ID(_feature_version), },
|
||||
};
|
||||
# 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[] = {"source", "filename", "mode", "flags", "dont_inherit", "optimize", "_feature_version", NULL};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -504,18 +484,9 @@ static PyObject *
|
|||
builtin_exec(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
|
||||
|
||||
#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)
|
||||
|
||||
static struct {
|
||||
PyGC_Head _this_is_not_used;
|
||||
PyObject_VAR_HEAD
|
||||
|
@ -524,13 +495,12 @@ builtin_exec(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject
|
|||
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
|
||||
.ob_item = { &_Py_ID(closure), },
|
||||
};
|
||||
# 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[] = {"", "", "", "closure", NULL};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -848,18 +818,9 @@ static PyObject *
|
|||
builtin_pow(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
|
||||
|
||||
#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)
|
||||
|
||||
static struct {
|
||||
PyGC_Head _this_is_not_used;
|
||||
PyObject_VAR_HEAD
|
||||
|
@ -868,13 +829,12 @@ builtin_pow(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject
|
|||
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
|
||||
.ob_item = { &_Py_ID(base), &_Py_ID(exp), &_Py_ID(mod), },
|
||||
};
|
||||
# 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[] = {"base", "exp", "mod", NULL};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -932,18 +892,9 @@ static PyObject *
|
|||
builtin_print(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
|
||||
|
||||
#define NUM_KEYWORDS 4
|
||||
#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)
|
||||
|
||||
static struct {
|
||||
PyGC_Head _this_is_not_used;
|
||||
PyObject_VAR_HEAD
|
||||
|
@ -952,13 +903,12 @@ builtin_print(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec
|
|||
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
|
||||
.ob_item = { &_Py_ID(sep), &_Py_ID(end), &_Py_ID(file), &_Py_ID(flush), },
|
||||
};
|
||||
# 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[] = {"sep", "end", "file", "flush", NULL};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -1081,18 +1031,9 @@ static PyObject *
|
|||
builtin_round(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
|
||||
|
||||
#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)
|
||||
|
||||
static struct {
|
||||
PyGC_Head _this_is_not_used;
|
||||
PyObject_VAR_HEAD
|
||||
|
@ -1101,13 +1042,12 @@ builtin_round(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec
|
|||
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
|
||||
.ob_item = { &_Py_ID(number), &_Py_ID(ndigits), },
|
||||
};
|
||||
# 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[] = {"number", "ndigits", NULL};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -1157,18 +1097,9 @@ static PyObject *
|
|||
builtin_sum(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
|
||||
|
||||
#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)
|
||||
|
||||
static struct {
|
||||
PyGC_Head _this_is_not_used;
|
||||
PyObject_VAR_HEAD
|
||||
|
@ -1177,13 +1108,12 @@ builtin_sum(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject
|
|||
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
|
||||
.ob_item = { &_Py_ID(start), },
|
||||
};
|
||||
# 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[] = {"", "start", NULL};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -1282,4 +1212,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=4590e66a40312a9f input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=919725bf5d400acf input=a9049054013a1b77]*/
|
||||
|
|
50
Python/clinic/import.c.h
generated
50
Python/clinic/import.c.h
generated
|
@ -199,18 +199,9 @@ static PyObject *
|
|||
_imp_find_frozen(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
|
||||
|
||||
#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)
|
||||
|
||||
static struct {
|
||||
PyGC_Head _this_is_not_used;
|
||||
PyObject_VAR_HEAD
|
||||
|
@ -219,13 +210,12 @@ _imp_find_frozen(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb
|
|||
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
|
||||
.ob_item = { &_Py_ID(withdata), },
|
||||
};
|
||||
# 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[] = {"", "withdata", NULL};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -565,18 +555,9 @@ static PyObject *
|
|||
_imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
|
||||
|
||||
#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)
|
||||
|
||||
static struct {
|
||||
PyGC_Head _this_is_not_used;
|
||||
PyObject_VAR_HEAD
|
||||
|
@ -585,13 +566,12 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb
|
|||
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
|
||||
.ob_item = { &_Py_ID(key), &_Py_ID(source), },
|
||||
};
|
||||
# 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[] = {"key", "source", NULL};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -637,4 +617,4 @@ exit:
|
|||
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
|
||||
#define _IMP_EXEC_DYNAMIC_METHODDEF
|
||||
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
|
||||
/*[clinic end generated code: output=7d75c10a93f2f26c input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=806352838c3f7008 input=a9049054013a1b77]*/
|
||||
|
|
50
Python/clinic/sysmodule.c.h
generated
50
Python/clinic/sysmodule.c.h
generated
|
@ -24,18 +24,9 @@ static PyObject *
|
|||
sys_addaudithook(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
|
||||
|
||||
#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)
|
||||
|
||||
static struct {
|
||||
PyGC_Head _this_is_not_used;
|
||||
PyObject_VAR_HEAD
|
||||
|
@ -44,13 +35,12 @@ sys_addaudithook(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb
|
|||
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
|
||||
.ob_item = { &_Py_ID(hook), },
|
||||
};
|
||||
# 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[] = {"hook", NULL};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -464,18 +454,9 @@ static PyObject *
|
|||
sys_set_coroutine_origin_tracking_depth(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
|
||||
|
||||
#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)
|
||||
|
||||
static struct {
|
||||
PyGC_Head _this_is_not_used;
|
||||
PyObject_VAR_HEAD
|
||||
|
@ -484,13 +465,12 @@ sys_set_coroutine_origin_tracking_depth(PyObject *module, PyObject *const *args,
|
|||
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
|
||||
.ob_item = { &_Py_ID(depth), },
|
||||
};
|
||||
# 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[] = {"depth", NULL};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -1190,4 +1170,4 @@ sys_getandroidapilevel(PyObject *module, PyObject *Py_UNUSED(ignored))
|
|||
#ifndef SYS_GETANDROIDAPILEVEL_METHODDEF
|
||||
#define SYS_GETANDROIDAPILEVEL_METHODDEF
|
||||
#endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */
|
||||
/*[clinic end generated code: output=b8b125686bc745a6 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=38446a4c76e2f3b6 input=a9049054013a1b77]*/
|
||||
|
|
26
Python/clinic/traceback.c.h
generated
26
Python/clinic/traceback.c.h
generated
|
@ -22,18 +22,9 @@ static PyObject *
|
|||
tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
|
||||
|
||||
#define NUM_KEYWORDS 4
|
||||
#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)
|
||||
|
||||
static struct {
|
||||
PyGC_Head _this_is_not_used;
|
||||
PyObject_VAR_HEAD
|
||||
|
@ -42,13 +33,12 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
|
|||
.ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
|
||||
.ob_item = { &_Py_ID(tb_next), &_Py_ID(tb_frame), &_Py_ID(tb_lasti), &_Py_ID(tb_lineno), },
|
||||
};
|
||||
# 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[] = {"tb_next", "tb_frame", "tb_lasti", "tb_lineno", NULL};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -88,4 +78,4 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=130ba2a638849c70 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=7bc9927e362fdfb7 input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue