bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955)
the bare METH_FASTCALL be used for functions with positional-only
parameters.
diff --git a/Modules/clinic/_struct.c.h b/Modules/clinic/_struct.c.h
index d0f0cd0..c273ee3 100644
--- a/Modules/clinic/_struct.c.h
+++ b/Modules/clinic/_struct.c.h
@@ -84,7 +84,7 @@
"See help(struct) for more on format strings.");
#define STRUCT_UNPACK_FROM_METHODDEF \
- {"unpack_from", (PyCFunction)Struct_unpack_from, METH_FASTCALL, Struct_unpack_from__doc__},
+ {"unpack_from", (PyCFunction)Struct_unpack_from, METH_FASTCALL|METH_KEYWORDS, Struct_unpack_from__doc__},
static PyObject *
Struct_unpack_from_impl(PyStructObject *self, Py_buffer *buffer,
@@ -198,16 +198,12 @@
unpack_impl(PyObject *module, PyStructObject *s_object, Py_buffer *buffer);
static PyObject *
-unpack(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+unpack(PyObject *module, PyObject **args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
PyStructObject *s_object = NULL;
Py_buffer buffer = {NULL, NULL};
- if (!_PyArg_NoStackKeywords("unpack", kwnames)) {
- goto exit;
- }
-
if (!_PyArg_ParseStack(args, nargs, "O&y*:unpack",
cache_struct_converter, &s_object, &buffer)) {
goto exit;
@@ -236,7 +232,7 @@
"See help(struct) for more on format strings.");
#define UNPACK_FROM_METHODDEF \
- {"unpack_from", (PyCFunction)unpack_from, METH_FASTCALL, unpack_from__doc__},
+ {"unpack_from", (PyCFunction)unpack_from, METH_FASTCALL|METH_KEYWORDS, unpack_from__doc__},
static PyObject *
unpack_from_impl(PyObject *module, PyStructObject *s_object,
@@ -288,16 +284,12 @@
PyObject *buffer);
static PyObject *
-iter_unpack(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+iter_unpack(PyObject *module, PyObject **args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
PyStructObject *s_object = NULL;
PyObject *buffer;
- if (!_PyArg_NoStackKeywords("iter_unpack", kwnames)) {
- goto exit;
- }
-
if (!_PyArg_ParseStack(args, nargs, "O&O:iter_unpack",
cache_struct_converter, &s_object, &buffer)) {
goto exit;
@@ -310,4 +302,4 @@
return return_value;
}
-/*[clinic end generated code: output=351350320f31ca82 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=fce060787b4c5261 input=a9049054013a1b77]*/