Run Argument Clinic: METH_VARARGS=>METH_FASTCALL
Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling
convention for functions using "boring" positional arguments.
Manually fix _elementtree: _elementtree_XMLParser_doctype() must remain
consistent with the clinic code.
diff --git a/Objects/clinic/dictobject.c.h b/Objects/clinic/dictobject.c.h
index d0cdfc3..3f06c0b 100644
--- a/Objects/clinic/dictobject.c.h
+++ b/Objects/clinic/dictobject.c.h
@@ -9,23 +9,27 @@
"Returns a new dict with keys from iterable and values equal to value.");
#define DICT_FROMKEYS_METHODDEF \
- {"fromkeys", (PyCFunction)dict_fromkeys, METH_VARARGS|METH_CLASS, dict_fromkeys__doc__},
+ {"fromkeys", (PyCFunction)dict_fromkeys, METH_FASTCALL|METH_CLASS, dict_fromkeys__doc__},
static PyObject *
dict_fromkeys_impl(PyTypeObject *type, PyObject *iterable, PyObject *value);
static PyObject *
-dict_fromkeys(PyTypeObject *type, PyObject *args)
+dict_fromkeys(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *iterable;
PyObject *value = Py_None;
- if (!PyArg_UnpackTuple(args, "fromkeys",
+ if (!_PyArg_UnpackStack(args, nargs, "fromkeys",
1, 2,
&iterable, &value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("fromkeys", kwnames)) {
+ goto exit;
+ }
return_value = dict_fromkeys_impl(type, iterable, value);
exit:
@@ -40,4 +44,4 @@
#define DICT___CONTAINS___METHODDEF \
{"__contains__", (PyCFunction)dict___contains__, METH_O|METH_COEXIST, dict___contains____doc__},
-/*[clinic end generated code: output=926326109e3d9839 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=69f3d767ed44e8ec input=a9049054013a1b77]*/