GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Argument Clinic includes internal headers in generated output unconditionally · Issue #107603 · python/cpython Closed Labels topic-argument-clinictype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionIt seems like Argument Clinic generates code that define Details/*[clinic input] preserve [clinic start generated code]*/ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) # include "pycore_gc.h" // PyGC_Head # include "pycore_runtime.h" // _Py_ID() #endif PyDoc_STRVAR(func__doc__, "func($module, a, /)\n" "--\n" "\n"); #define FUNC_METHODDEF \ {"func", (PyCFunction)func, METH_O, func__doc__}, /*[clinic end generated code: output=851b6645c29cfa0d input=a9049054013a1b77]*/ OTOH, a Details/*[clinic input] preserve [clinic start generated code]*/ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) # include "pycore_gc.h" // PyGC_Head # include "pycore_runtime.h" // _Py_ID() #endif PyDoc_STRVAR(func__doc__, "func($module, /, a, b)\n" "--\n" "\n"); #define FUNC_METHODDEF \ {"func", _PyCFunction_CAST(func), METH_FASTCALL|METH_KEYWORDS, func__doc__}, static PyObject * func_impl(PyObject *module, PyObject *a, PyObject *b); static PyObject * func(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 static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD PyObject *ob_item[NUM_KEYWORDS]; } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) .ob_item = { &_Py_ID(a), &_Py_ID(b), }, }; #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[] = {"a", "b", NULL}; static _PyArg_Parser _parser = { .keywords = _keywords, .fname = "func", .kwtuple = KWTUPLE, }; #undef KWTUPLE PyObject *argsbuf[2]; PyObject *a; PyObject *b; args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf); if (!args) { goto exit; } a = args[0]; b = args[1]; return_value = func_impl(module, a, b); exit: return return_value; } /*[clinic end generated code: output=e790cd95ffc517a0 input=a9049054013a1b77]*/ Argument Clinic should check if those defines/includes are needed before generating the output. Linked PRsActivity
MetadataMetadataAssigneesLabelstopic-argument-clinictype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |