diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-01-17 01:21:47 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-01-17 01:21:47 (GMT) |
commit | 0c4a828cadfccd8b95a39f7930705de75ed5f729 (patch) | |
tree | 713eeceb5c63f4324fa83e9603a0284272e9eb58 /Modules | |
parent | 093119e4eb8424451ef24a5a5a3ce9881d77abd5 (diff) | |
download | cpython-0c4a828cadfccd8b95a39f7930705de75ed5f729.zip cpython-0c4a828cadfccd8b95a39f7930705de75ed5f729.tar.gz cpython-0c4a828cadfccd8b95a39f7930705de75ed5f729.tar.bz2 |
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.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_elementtree.c | 2 | ||||
-rw-r--r-- | Modules/_io/clinic/bufferedio.c.h | 12 | ||||
-rw-r--r-- | Modules/_io/clinic/bytesio.c.h | 52 | ||||
-rw-r--r-- | Modules/_io/clinic/fileio.c.h | 12 | ||||
-rw-r--r-- | Modules/_io/clinic/stringio.c.h | 32 | ||||
-rw-r--r-- | Modules/_io/clinic/textio.c.h | 12 | ||||
-rw-r--r-- | Modules/cjkcodecs/clinic/multibytecodec.c.h | 32 | ||||
-rw-r--r-- | Modules/clinic/_elementtree.c.h | 52 | ||||
-rw-r--r-- | Modules/clinic/_gdbmmodule.c.h | 22 | ||||
-rw-r--r-- | Modules/clinic/_pickle.c.h | 12 | ||||
-rw-r--r-- | Modules/clinic/_sre.c.h | 32 | ||||
-rw-r--r-- | Modules/clinic/signalmodule.c.h | 12 |
12 files changed, 194 insertions, 90 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 5d63913..2d623dc 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -2743,7 +2743,7 @@ typedef struct { } XMLParserObject; static PyObject* -_elementtree_XMLParser_doctype(XMLParserObject* self, PyObject* args); +_elementtree_XMLParser_doctype(XMLParserObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames); static PyObject * _elementtree_XMLParser_doctype_impl(XMLParserObject *self, PyObject *name, PyObject *pubid, PyObject *system); diff --git a/Modules/_io/clinic/bufferedio.c.h b/Modules/_io/clinic/bufferedio.c.h index ed584f8..4337ecf 100644 --- a/Modules/_io/clinic/bufferedio.c.h +++ b/Modules/_io/clinic/bufferedio.c.h @@ -309,22 +309,26 @@ PyDoc_STRVAR(_io__Buffered_truncate__doc__, "\n"); #define _IO__BUFFERED_TRUNCATE_METHODDEF \ - {"truncate", (PyCFunction)_io__Buffered_truncate, METH_VARARGS, _io__Buffered_truncate__doc__}, + {"truncate", (PyCFunction)_io__Buffered_truncate, METH_FASTCALL, _io__Buffered_truncate__doc__}, static PyObject * _io__Buffered_truncate_impl(buffered *self, PyObject *pos); static PyObject * -_io__Buffered_truncate(buffered *self, PyObject *args) +_io__Buffered_truncate(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *pos = Py_None; - if (!PyArg_UnpackTuple(args, "truncate", + if (!_PyArg_UnpackStack(args, nargs, "truncate", 0, 1, &pos)) { goto exit; } + + if (!_PyArg_NoStackKeywords("truncate", kwnames)) { + goto exit; + } return_value = _io__Buffered_truncate_impl(self, pos); exit: @@ -496,4 +500,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=e6e584216a10d67e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e37b969b1acaa09c input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h index 11b976c..656e7ec 100644 --- a/Modules/_io/clinic/bytesio.c.h +++ b/Modules/_io/clinic/bytesio.c.h @@ -158,22 +158,26 @@ PyDoc_STRVAR(_io_BytesIO_read__doc__, "Return an empty bytes object at EOF."); #define _IO_BYTESIO_READ_METHODDEF \ - {"read", (PyCFunction)_io_BytesIO_read, METH_VARARGS, _io_BytesIO_read__doc__}, + {"read", (PyCFunction)_io_BytesIO_read, METH_FASTCALL, _io_BytesIO_read__doc__}, static PyObject * _io_BytesIO_read_impl(bytesio *self, PyObject *arg); static PyObject * -_io_BytesIO_read(bytesio *self, PyObject *args) +_io_BytesIO_read(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *arg = Py_None; - if (!PyArg_UnpackTuple(args, "read", + if (!_PyArg_UnpackStack(args, nargs, "read", 0, 1, &arg)) { goto exit; } + + if (!_PyArg_NoStackKeywords("read", kwnames)) { + goto exit; + } return_value = _io_BytesIO_read_impl(self, arg); exit: @@ -190,22 +194,26 @@ PyDoc_STRVAR(_io_BytesIO_read1__doc__, "Return an empty bytes object at EOF."); #define _IO_BYTESIO_READ1_METHODDEF \ - {"read1", (PyCFunction)_io_BytesIO_read1, METH_VARARGS, _io_BytesIO_read1__doc__}, + {"read1", (PyCFunction)_io_BytesIO_read1, METH_FASTCALL, _io_BytesIO_read1__doc__}, static PyObject * _io_BytesIO_read1_impl(bytesio *self, PyObject *size); static PyObject * -_io_BytesIO_read1(bytesio *self, PyObject *args) +_io_BytesIO_read1(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *size = Py_None; - if (!PyArg_UnpackTuple(args, "read1", + if (!_PyArg_UnpackStack(args, nargs, "read1", 0, 1, &size)) { goto exit; } + + if (!_PyArg_NoStackKeywords("read1", kwnames)) { + goto exit; + } return_value = _io_BytesIO_read1_impl(self, size); exit: @@ -223,22 +231,26 @@ PyDoc_STRVAR(_io_BytesIO_readline__doc__, "Return an empty bytes object at EOF."); #define _IO_BYTESIO_READLINE_METHODDEF \ - {"readline", (PyCFunction)_io_BytesIO_readline, METH_VARARGS, _io_BytesIO_readline__doc__}, + {"readline", (PyCFunction)_io_BytesIO_readline, METH_FASTCALL, _io_BytesIO_readline__doc__}, static PyObject * _io_BytesIO_readline_impl(bytesio *self, PyObject *arg); static PyObject * -_io_BytesIO_readline(bytesio *self, PyObject *args) +_io_BytesIO_readline(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *arg = Py_None; - if (!PyArg_UnpackTuple(args, "readline", + if (!_PyArg_UnpackStack(args, nargs, "readline", 0, 1, &arg)) { goto exit; } + + if (!_PyArg_NoStackKeywords("readline", kwnames)) { + goto exit; + } return_value = _io_BytesIO_readline_impl(self, arg); exit: @@ -256,22 +268,26 @@ PyDoc_STRVAR(_io_BytesIO_readlines__doc__, "total number of bytes in the lines returned."); #define _IO_BYTESIO_READLINES_METHODDEF \ - {"readlines", (PyCFunction)_io_BytesIO_readlines, METH_VARARGS, _io_BytesIO_readlines__doc__}, + {"readlines", (PyCFunction)_io_BytesIO_readlines, METH_FASTCALL, _io_BytesIO_readlines__doc__}, static PyObject * _io_BytesIO_readlines_impl(bytesio *self, PyObject *arg); static PyObject * -_io_BytesIO_readlines(bytesio *self, PyObject *args) +_io_BytesIO_readlines(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *arg = Py_None; - if (!PyArg_UnpackTuple(args, "readlines", + if (!_PyArg_UnpackStack(args, nargs, "readlines", 0, 1, &arg)) { goto exit; } + + if (!_PyArg_NoStackKeywords("readlines", kwnames)) { + goto exit; + } return_value = _io_BytesIO_readlines_impl(self, arg); exit: @@ -323,22 +339,26 @@ PyDoc_STRVAR(_io_BytesIO_truncate__doc__, "The current file position is unchanged. Returns the new size."); #define _IO_BYTESIO_TRUNCATE_METHODDEF \ - {"truncate", (PyCFunction)_io_BytesIO_truncate, METH_VARARGS, _io_BytesIO_truncate__doc__}, + {"truncate", (PyCFunction)_io_BytesIO_truncate, METH_FASTCALL, _io_BytesIO_truncate__doc__}, static PyObject * _io_BytesIO_truncate_impl(bytesio *self, PyObject *arg); static PyObject * -_io_BytesIO_truncate(bytesio *self, PyObject *args) +_io_BytesIO_truncate(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *arg = Py_None; - if (!PyArg_UnpackTuple(args, "truncate", + if (!_PyArg_UnpackStack(args, nargs, "truncate", 0, 1, &arg)) { goto exit; } + + if (!_PyArg_NoStackKeywords("truncate", kwnames)) { + goto exit; + } return_value = _io_BytesIO_truncate_impl(self, arg); exit: @@ -452,4 +472,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=056f24eece495a8f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=138ee6ad6951bc84 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h index 411a8c0..7a8e2c6 100644 --- a/Modules/_io/clinic/fileio.c.h +++ b/Modules/_io/clinic/fileio.c.h @@ -336,22 +336,26 @@ PyDoc_STRVAR(_io_FileIO_truncate__doc__, "The current file position is changed to the value of size."); #define _IO_FILEIO_TRUNCATE_METHODDEF \ - {"truncate", (PyCFunction)_io_FileIO_truncate, METH_VARARGS, _io_FileIO_truncate__doc__}, + {"truncate", (PyCFunction)_io_FileIO_truncate, METH_FASTCALL, _io_FileIO_truncate__doc__}, static PyObject * _io_FileIO_truncate_impl(fileio *self, PyObject *posobj); static PyObject * -_io_FileIO_truncate(fileio *self, PyObject *args) +_io_FileIO_truncate(fileio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *posobj = NULL; - if (!PyArg_UnpackTuple(args, "truncate", + if (!_PyArg_UnpackStack(args, nargs, "truncate", 0, 1, &posobj)) { goto exit; } + + if (!_PyArg_NoStackKeywords("truncate", kwnames)) { + goto exit; + } return_value = _io_FileIO_truncate_impl(self, posobj); exit: @@ -381,4 +385,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO_FILEIO_TRUNCATE_METHODDEF #define _IO_FILEIO_TRUNCATE_METHODDEF #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ -/*[clinic end generated code: output=5c2a0b493c0af58b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=034d782a0daa82bd input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/stringio.c.h b/Modules/_io/clinic/stringio.c.h index e617201..af467d6 100644 --- a/Modules/_io/clinic/stringio.c.h +++ b/Modules/_io/clinic/stringio.c.h @@ -48,22 +48,26 @@ PyDoc_STRVAR(_io_StringIO_read__doc__, "is reached. Return an empty string at EOF."); #define _IO_STRINGIO_READ_METHODDEF \ - {"read", (PyCFunction)_io_StringIO_read, METH_VARARGS, _io_StringIO_read__doc__}, + {"read", (PyCFunction)_io_StringIO_read, METH_FASTCALL, _io_StringIO_read__doc__}, static PyObject * _io_StringIO_read_impl(stringio *self, PyObject *arg); static PyObject * -_io_StringIO_read(stringio *self, PyObject *args) +_io_StringIO_read(stringio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *arg = Py_None; - if (!PyArg_UnpackTuple(args, "read", + if (!_PyArg_UnpackStack(args, nargs, "read", 0, 1, &arg)) { goto exit; } + + if (!_PyArg_NoStackKeywords("read", kwnames)) { + goto exit; + } return_value = _io_StringIO_read_impl(self, arg); exit: @@ -79,22 +83,26 @@ PyDoc_STRVAR(_io_StringIO_readline__doc__, "Returns an empty string if EOF is hit immediately."); #define _IO_STRINGIO_READLINE_METHODDEF \ - {"readline", (PyCFunction)_io_StringIO_readline, METH_VARARGS, _io_StringIO_readline__doc__}, + {"readline", (PyCFunction)_io_StringIO_readline, METH_FASTCALL, _io_StringIO_readline__doc__}, static PyObject * _io_StringIO_readline_impl(stringio *self, PyObject *arg); static PyObject * -_io_StringIO_readline(stringio *self, PyObject *args) +_io_StringIO_readline(stringio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *arg = Py_None; - if (!PyArg_UnpackTuple(args, "readline", + if (!_PyArg_UnpackStack(args, nargs, "readline", 0, 1, &arg)) { goto exit; } + + if (!_PyArg_NoStackKeywords("readline", kwnames)) { + goto exit; + } return_value = _io_StringIO_readline_impl(self, arg); exit: @@ -112,22 +120,26 @@ PyDoc_STRVAR(_io_StringIO_truncate__doc__, "Returns the new absolute position."); #define _IO_STRINGIO_TRUNCATE_METHODDEF \ - {"truncate", (PyCFunction)_io_StringIO_truncate, METH_VARARGS, _io_StringIO_truncate__doc__}, + {"truncate", (PyCFunction)_io_StringIO_truncate, METH_FASTCALL, _io_StringIO_truncate__doc__}, static PyObject * _io_StringIO_truncate_impl(stringio *self, PyObject *arg); static PyObject * -_io_StringIO_truncate(stringio *self, PyObject *args) +_io_StringIO_truncate(stringio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *arg = Py_None; - if (!PyArg_UnpackTuple(args, "truncate", + if (!_PyArg_UnpackStack(args, nargs, "truncate", 0, 1, &arg)) { goto exit; } + + if (!_PyArg_NoStackKeywords("truncate", kwnames)) { + goto exit; + } return_value = _io_StringIO_truncate_impl(self, arg); exit: @@ -293,4 +305,4 @@ _io_StringIO_seekable(stringio *self, PyObject *Py_UNUSED(ignored)) { return _io_StringIO_seekable_impl(self); } -/*[clinic end generated code: output=69bf262268745061 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ce8018ec29def422 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h index 1844e4d..46b3eda 100644 --- a/Modules/_io/clinic/textio.c.h +++ b/Modules/_io/clinic/textio.c.h @@ -336,22 +336,26 @@ PyDoc_STRVAR(_io_TextIOWrapper_truncate__doc__, "\n"); #define _IO_TEXTIOWRAPPER_TRUNCATE_METHODDEF \ - {"truncate", (PyCFunction)_io_TextIOWrapper_truncate, METH_VARARGS, _io_TextIOWrapper_truncate__doc__}, + {"truncate", (PyCFunction)_io_TextIOWrapper_truncate, METH_FASTCALL, _io_TextIOWrapper_truncate__doc__}, static PyObject * _io_TextIOWrapper_truncate_impl(textio *self, PyObject *pos); static PyObject * -_io_TextIOWrapper_truncate(textio *self, PyObject *args) +_io_TextIOWrapper_truncate(textio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *pos = Py_None; - if (!PyArg_UnpackTuple(args, "truncate", + if (!_PyArg_UnpackStack(args, nargs, "truncate", 0, 1, &pos)) { goto exit; } + + if (!_PyArg_NoStackKeywords("truncate", kwnames)) { + goto exit; + } return_value = _io_TextIOWrapper_truncate_impl(self, pos); exit: @@ -476,4 +480,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored)) { return _io_TextIOWrapper_close_impl(self); } -/*[clinic end generated code: output=1f8367c7a3301670 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=67eba50449900a96 input=a9049054013a1b77]*/ diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h index 005a1ba..4be06bb 100644 --- a/Modules/cjkcodecs/clinic/multibytecodec.c.h +++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h @@ -192,23 +192,27 @@ PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_read__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READ_METHODDEF \ - {"read", (PyCFunction)_multibytecodec_MultibyteStreamReader_read, METH_VARARGS, _multibytecodec_MultibyteStreamReader_read__doc__}, + {"read", (PyCFunction)_multibytecodec_MultibyteStreamReader_read, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_read__doc__}, static PyObject * _multibytecodec_MultibyteStreamReader_read_impl(MultibyteStreamReaderObject *self, PyObject *sizeobj); static PyObject * -_multibytecodec_MultibyteStreamReader_read(MultibyteStreamReaderObject *self, PyObject *args) +_multibytecodec_MultibyteStreamReader_read(MultibyteStreamReaderObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *sizeobj = Py_None; - if (!PyArg_UnpackTuple(args, "read", + if (!_PyArg_UnpackStack(args, nargs, "read", 0, 1, &sizeobj)) { goto exit; } + + if (!_PyArg_NoStackKeywords("read", kwnames)) { + goto exit; + } return_value = _multibytecodec_MultibyteStreamReader_read_impl(self, sizeobj); exit: @@ -221,23 +225,27 @@ PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readline__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINE_METHODDEF \ - {"readline", (PyCFunction)_multibytecodec_MultibyteStreamReader_readline, METH_VARARGS, _multibytecodec_MultibyteStreamReader_readline__doc__}, + {"readline", (PyCFunction)_multibytecodec_MultibyteStreamReader_readline, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readline__doc__}, static PyObject * _multibytecodec_MultibyteStreamReader_readline_impl(MultibyteStreamReaderObject *self, PyObject *sizeobj); static PyObject * -_multibytecodec_MultibyteStreamReader_readline(MultibyteStreamReaderObject *self, PyObject *args) +_multibytecodec_MultibyteStreamReader_readline(MultibyteStreamReaderObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *sizeobj = Py_None; - if (!PyArg_UnpackTuple(args, "readline", + if (!_PyArg_UnpackStack(args, nargs, "readline", 0, 1, &sizeobj)) { goto exit; } + + if (!_PyArg_NoStackKeywords("readline", kwnames)) { + goto exit; + } return_value = _multibytecodec_MultibyteStreamReader_readline_impl(self, sizeobj); exit: @@ -250,23 +258,27 @@ PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readlines__doc__, "\n"); #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINES_METHODDEF \ - {"readlines", (PyCFunction)_multibytecodec_MultibyteStreamReader_readlines, METH_VARARGS, _multibytecodec_MultibyteStreamReader_readlines__doc__}, + {"readlines", (PyCFunction)_multibytecodec_MultibyteStreamReader_readlines, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readlines__doc__}, static PyObject * _multibytecodec_MultibyteStreamReader_readlines_impl(MultibyteStreamReaderObject *self, PyObject *sizehintobj); static PyObject * -_multibytecodec_MultibyteStreamReader_readlines(MultibyteStreamReaderObject *self, PyObject *args) +_multibytecodec_MultibyteStreamReader_readlines(MultibyteStreamReaderObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *sizehintobj = Py_None; - if (!PyArg_UnpackTuple(args, "readlines", + if (!_PyArg_UnpackStack(args, nargs, "readlines", 0, 1, &sizehintobj)) { goto exit; } + + if (!_PyArg_NoStackKeywords("readlines", kwnames)) { + goto exit; + } return_value = _multibytecodec_MultibyteStreamReader_readlines_impl(self, sizehintobj); exit: @@ -330,4 +342,4 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__, #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \ {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__}, -/*[clinic end generated code: output=7d6a05b0a581fd17 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=26710ffd4b3c7d7e input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h index 410794e..c13cb35 100644 --- a/Modules/clinic/_elementtree.c.h +++ b/Modules/clinic/_elementtree.c.h @@ -423,24 +423,28 @@ PyDoc_STRVAR(_elementtree_Element_makeelement__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_MAKEELEMENT_METHODDEF \ - {"makeelement", (PyCFunction)_elementtree_Element_makeelement, METH_VARARGS, _elementtree_Element_makeelement__doc__}, + {"makeelement", (PyCFunction)_elementtree_Element_makeelement, METH_FASTCALL, _elementtree_Element_makeelement__doc__}, static PyObject * _elementtree_Element_makeelement_impl(ElementObject *self, PyObject *tag, PyObject *attrib); static PyObject * -_elementtree_Element_makeelement(ElementObject *self, PyObject *args) +_elementtree_Element_makeelement(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *tag; PyObject *attrib; - if (!PyArg_UnpackTuple(args, "makeelement", + if (!_PyArg_UnpackStack(args, nargs, "makeelement", 2, 2, &tag, &attrib)) { goto exit; } + + if (!_PyArg_NoStackKeywords("makeelement", kwnames)) { + goto exit; + } return_value = _elementtree_Element_makeelement_impl(self, tag, attrib); exit: @@ -479,24 +483,28 @@ PyDoc_STRVAR(_elementtree_Element_set__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_SET_METHODDEF \ - {"set", (PyCFunction)_elementtree_Element_set, METH_VARARGS, _elementtree_Element_set__doc__}, + {"set", (PyCFunction)_elementtree_Element_set, METH_FASTCALL, _elementtree_Element_set__doc__}, static PyObject * _elementtree_Element_set_impl(ElementObject *self, PyObject *key, PyObject *value); static PyObject * -_elementtree_Element_set(ElementObject *self, PyObject *args) +_elementtree_Element_set(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *key; PyObject *value; - if (!PyArg_UnpackTuple(args, "set", + if (!_PyArg_UnpackStack(args, nargs, "set", 2, 2, &key, &value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("set", kwnames)) { + goto exit; + } return_value = _elementtree_Element_set_impl(self, key, value); exit: @@ -564,24 +572,28 @@ PyDoc_STRVAR(_elementtree_TreeBuilder_start__doc__, "\n"); #define _ELEMENTTREE_TREEBUILDER_START_METHODDEF \ - {"start", (PyCFunction)_elementtree_TreeBuilder_start, METH_VARARGS, _elementtree_TreeBuilder_start__doc__}, + {"start", (PyCFunction)_elementtree_TreeBuilder_start, METH_FASTCALL, _elementtree_TreeBuilder_start__doc__}, static PyObject * _elementtree_TreeBuilder_start_impl(TreeBuilderObject *self, PyObject *tag, PyObject *attrs); static PyObject * -_elementtree_TreeBuilder_start(TreeBuilderObject *self, PyObject *args) +_elementtree_TreeBuilder_start(TreeBuilderObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *tag; PyObject *attrs = Py_None; - if (!PyArg_UnpackTuple(args, "start", + if (!_PyArg_UnpackStack(args, nargs, "start", 1, 2, &tag, &attrs)) { goto exit; } + + if (!_PyArg_NoStackKeywords("start", kwnames)) { + goto exit; + } return_value = _elementtree_TreeBuilder_start_impl(self, tag, attrs); exit: @@ -651,25 +663,29 @@ PyDoc_STRVAR(_elementtree_XMLParser_doctype__doc__, "\n"); #define _ELEMENTTREE_XMLPARSER_DOCTYPE_METHODDEF \ - {"doctype", (PyCFunction)_elementtree_XMLParser_doctype, METH_VARARGS, _elementtree_XMLParser_doctype__doc__}, + {"doctype", (PyCFunction)_elementtree_XMLParser_doctype, METH_FASTCALL, _elementtree_XMLParser_doctype__doc__}, static PyObject * _elementtree_XMLParser_doctype_impl(XMLParserObject *self, PyObject *name, PyObject *pubid, PyObject *system); static PyObject * -_elementtree_XMLParser_doctype(XMLParserObject *self, PyObject *args) +_elementtree_XMLParser_doctype(XMLParserObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *name; PyObject *pubid; PyObject *system; - if (!PyArg_UnpackTuple(args, "doctype", + if (!_PyArg_UnpackStack(args, nargs, "doctype", 3, 3, &name, &pubid, &system)) { goto exit; } + + if (!_PyArg_NoStackKeywords("doctype", kwnames)) { + goto exit; + } return_value = _elementtree_XMLParser_doctype_impl(self, name, pubid, system); exit: @@ -682,7 +698,7 @@ PyDoc_STRVAR(_elementtree_XMLParser__setevents__doc__, "\n"); #define _ELEMENTTREE_XMLPARSER__SETEVENTS_METHODDEF \ - {"_setevents", (PyCFunction)_elementtree_XMLParser__setevents, METH_VARARGS, _elementtree_XMLParser__setevents__doc__}, + {"_setevents", (PyCFunction)_elementtree_XMLParser__setevents, METH_FASTCALL, _elementtree_XMLParser__setevents__doc__}, static PyObject * _elementtree_XMLParser__setevents_impl(XMLParserObject *self, @@ -690,20 +706,24 @@ _elementtree_XMLParser__setevents_impl(XMLParserObject *self, PyObject *events_to_report); static PyObject * -_elementtree_XMLParser__setevents(XMLParserObject *self, PyObject *args) +_elementtree_XMLParser__setevents(XMLParserObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *events_queue; PyObject *events_to_report = Py_None; - if (!PyArg_UnpackTuple(args, "_setevents", + if (!_PyArg_UnpackStack(args, nargs, "_setevents", 1, 2, &events_queue, &events_to_report)) { goto exit; } + + if (!_PyArg_NoStackKeywords("_setevents", kwnames)) { + goto exit; + } return_value = _elementtree_XMLParser__setevents_impl(self, events_queue, events_to_report); exit: return return_value; } -/*[clinic end generated code: output=4e3d22c6f6d832b2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b69fa98c40917f58 input=a9049054013a1b77]*/ 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 @@ PyDoc_STRVAR(_gdbm_gdbm_get__doc__, "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 @@ PyDoc_STRVAR(_gdbm_gdbm_setdefault__doc__, "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 @@ dbmopen(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) exit: return return_value; } -/*[clinic end generated code: output=1e47d62a35eeba8b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=03a3a63a814ada93 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h index fdba8f9..e10730a 100644 --- a/Modules/clinic/_pickle.c.h +++ b/Modules/clinic/_pickle.c.h @@ -199,7 +199,7 @@ PyDoc_STRVAR(_pickle_Unpickler_find_class__doc__, "needed. Both arguments passed are str objects."); #define _PICKLE_UNPICKLER_FIND_CLASS_METHODDEF \ - {"find_class", (PyCFunction)_pickle_Unpickler_find_class, METH_VARARGS, _pickle_Unpickler_find_class__doc__}, + {"find_class", (PyCFunction)_pickle_Unpickler_find_class, METH_FASTCALL, _pickle_Unpickler_find_class__doc__}, static PyObject * _pickle_Unpickler_find_class_impl(UnpicklerObject *self, @@ -207,17 +207,21 @@ _pickle_Unpickler_find_class_impl(UnpicklerObject *self, PyObject *global_name); static PyObject * -_pickle_Unpickler_find_class(UnpicklerObject *self, PyObject *args) +_pickle_Unpickler_find_class(UnpicklerObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *module_name; PyObject *global_name; - if (!PyArg_UnpackTuple(args, "find_class", + if (!_PyArg_UnpackStack(args, nargs, "find_class", 2, 2, &module_name, &global_name)) { goto exit; } + + if (!_PyArg_NoStackKeywords("find_class", kwnames)) { + goto exit; + } return_value = _pickle_Unpickler_find_class_impl(self, module_name, global_name); exit: @@ -560,4 +564,4 @@ _pickle_loads(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn exit: return return_value; } -/*[clinic end generated code: output=d7222d1219039fbd input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b921d325b2f7a096 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_sre.c.h b/Modules/clinic/_sre.c.h index 39b2e27..fcb23e8 100644 --- a/Modules/clinic/_sre.c.h +++ b/Modules/clinic/_sre.c.h @@ -551,23 +551,27 @@ PyDoc_STRVAR(_sre_SRE_Match_start__doc__, "Return index of the start of the substring matched by group."); #define _SRE_SRE_MATCH_START_METHODDEF \ - {"start", (PyCFunction)_sre_SRE_Match_start, METH_VARARGS, _sre_SRE_Match_start__doc__}, + {"start", (PyCFunction)_sre_SRE_Match_start, METH_FASTCALL, _sre_SRE_Match_start__doc__}, static Py_ssize_t _sre_SRE_Match_start_impl(MatchObject *self, PyObject *group); static PyObject * -_sre_SRE_Match_start(MatchObject *self, PyObject *args) +_sre_SRE_Match_start(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *group = NULL; Py_ssize_t _return_value; - if (!PyArg_UnpackTuple(args, "start", + if (!_PyArg_UnpackStack(args, nargs, "start", 0, 1, &group)) { goto exit; } + + if (!_PyArg_NoStackKeywords("start", kwnames)) { + goto exit; + } _return_value = _sre_SRE_Match_start_impl(self, group); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; @@ -585,23 +589,27 @@ PyDoc_STRVAR(_sre_SRE_Match_end__doc__, "Return index of the end of the substring matched by group."); #define _SRE_SRE_MATCH_END_METHODDEF \ - {"end", (PyCFunction)_sre_SRE_Match_end, METH_VARARGS, _sre_SRE_Match_end__doc__}, + {"end", (PyCFunction)_sre_SRE_Match_end, METH_FASTCALL, _sre_SRE_Match_end__doc__}, static Py_ssize_t _sre_SRE_Match_end_impl(MatchObject *self, PyObject *group); static PyObject * -_sre_SRE_Match_end(MatchObject *self, PyObject *args) +_sre_SRE_Match_end(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *group = NULL; Py_ssize_t _return_value; - if (!PyArg_UnpackTuple(args, "end", + if (!_PyArg_UnpackStack(args, nargs, "end", 0, 1, &group)) { goto exit; } + + if (!_PyArg_NoStackKeywords("end", kwnames)) { + goto exit; + } _return_value = _sre_SRE_Match_end_impl(self, group); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; @@ -619,22 +627,26 @@ PyDoc_STRVAR(_sre_SRE_Match_span__doc__, "For MatchObject m, return the 2-tuple (m.start(group), m.end(group))."); #define _SRE_SRE_MATCH_SPAN_METHODDEF \ - {"span", (PyCFunction)_sre_SRE_Match_span, METH_VARARGS, _sre_SRE_Match_span__doc__}, + {"span", (PyCFunction)_sre_SRE_Match_span, METH_FASTCALL, _sre_SRE_Match_span__doc__}, static PyObject * _sre_SRE_Match_span_impl(MatchObject *self, PyObject *group); static PyObject * -_sre_SRE_Match_span(MatchObject *self, PyObject *args) +_sre_SRE_Match_span(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *group = NULL; - if (!PyArg_UnpackTuple(args, "span", + if (!_PyArg_UnpackStack(args, nargs, "span", 0, 1, &group)) { goto exit; } + + if (!_PyArg_NoStackKeywords("span", kwnames)) { + goto exit; + } return_value = _sre_SRE_Match_span_impl(self, group); exit: @@ -720,4 +732,4 @@ _sre_SRE_Scanner_search(ScannerObject *self, PyObject *Py_UNUSED(ignored)) { return _sre_SRE_Scanner_search_impl(self); } -/*[clinic end generated code: output=3dff18d3b6110b86 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5df18da8e2dc762c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/signalmodule.c.h b/Modules/clinic/signalmodule.c.h index 776dcba..9e16f32 100644 --- a/Modules/clinic/signalmodule.c.h +++ b/Modules/clinic/signalmodule.c.h @@ -353,24 +353,28 @@ PyDoc_STRVAR(signal_sigtimedwait__doc__, "The timeout is specified in seconds, with floating point numbers allowed."); #define SIGNAL_SIGTIMEDWAIT_METHODDEF \ - {"sigtimedwait", (PyCFunction)signal_sigtimedwait, METH_VARARGS, signal_sigtimedwait__doc__}, + {"sigtimedwait", (PyCFunction)signal_sigtimedwait, METH_FASTCALL, signal_sigtimedwait__doc__}, static PyObject * signal_sigtimedwait_impl(PyObject *module, PyObject *sigset, PyObject *timeout_obj); static PyObject * -signal_sigtimedwait(PyObject *module, PyObject *args) +signal_sigtimedwait(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *sigset; PyObject *timeout_obj; - if (!PyArg_UnpackTuple(args, "sigtimedwait", + if (!_PyArg_UnpackStack(args, nargs, "sigtimedwait", 2, 2, &sigset, &timeout_obj)) { goto exit; } + + if (!_PyArg_NoStackKeywords("sigtimedwait", kwnames)) { + goto exit; + } return_value = signal_sigtimedwait_impl(module, sigset, timeout_obj); exit: @@ -459,4 +463,4 @@ exit: #ifndef SIGNAL_PTHREAD_KILL_METHODDEF #define SIGNAL_PTHREAD_KILL_METHODDEF #endif /* !defined(SIGNAL_PTHREAD_KILL_METHODDEF) */ -/*[clinic end generated code: output=b49f7bfff44d1256 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fab3dba32c058588 input=a9049054013a1b77]*/ |