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/Modules/clinic/_gdbmmodule.c.h b/Modules/clinic/_gdbmmodule.c.h
index 77d258b..b91cea1 100644
--- a/Modules/clinic/_gdbmmodule.c.h
+++ b/Modules/clinic/_gdbmmodule.c.h
@@ -9,23 +9,27 @@
"Get the value for key, or default if not present.");
#define _GDBM_GDBM_GET_METHODDEF \
- {"get", (PyCFunction)_gdbm_gdbm_get, METH_VARARGS, _gdbm_gdbm_get__doc__},
+ {"get", (PyCFunction)_gdbm_gdbm_get, METH_FASTCALL, _gdbm_gdbm_get__doc__},
static PyObject *
_gdbm_gdbm_get_impl(dbmobject *self, PyObject *key, PyObject *default_value);
static PyObject *
-_gdbm_gdbm_get(dbmobject *self, PyObject *args)
+_gdbm_gdbm_get(dbmobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *key;
PyObject *default_value = Py_None;
- if (!PyArg_UnpackTuple(args, "get",
+ if (!_PyArg_UnpackStack(args, nargs, "get",
1, 2,
&key, &default_value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("get", kwnames)) {
+ goto exit;
+ }
return_value = _gdbm_gdbm_get_impl(self, key, default_value);
exit:
@@ -39,24 +43,28 @@
"Get value for key, or set it to default and return default if not present.");
#define _GDBM_GDBM_SETDEFAULT_METHODDEF \
- {"setdefault", (PyCFunction)_gdbm_gdbm_setdefault, METH_VARARGS, _gdbm_gdbm_setdefault__doc__},
+ {"setdefault", (PyCFunction)_gdbm_gdbm_setdefault, METH_FASTCALL, _gdbm_gdbm_setdefault__doc__},
static PyObject *
_gdbm_gdbm_setdefault_impl(dbmobject *self, PyObject *key,
PyObject *default_value);
static PyObject *
-_gdbm_gdbm_setdefault(dbmobject *self, PyObject *args)
+_gdbm_gdbm_setdefault(dbmobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *key;
PyObject *default_value = Py_None;
- if (!PyArg_UnpackTuple(args, "setdefault",
+ if (!_PyArg_UnpackStack(args, nargs, "setdefault",
1, 2,
&key, &default_value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("setdefault", kwnames)) {
+ goto exit;
+ }
return_value = _gdbm_gdbm_setdefault_impl(self, key, default_value);
exit:
@@ -257,4 +265,4 @@
exit:
return return_value;
}
-/*[clinic end generated code: output=1e47d62a35eeba8b input=a9049054013a1b77]*/
+/*[clinic end generated code: output=03a3a63a814ada93 input=a9049054013a1b77]*/