diff --git a/third_party/python/Modules/_elementtree.c b/third_party/python/Modules/_elementtree.c index a1c9372ad..a66ed801a 100644 --- a/third_party/python/Modules/_elementtree.c +++ b/third_party/python/Modules/_elementtree.c @@ -2807,7 +2807,8 @@ 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/third_party/python/Modules/_io/clinic/bufferedio.inc b/third_party/python/Modules/_io/clinic/bufferedio.inc index cb0a5f616..670c28c37 100644 --- a/third_party/python/Modules/_io/clinic/bufferedio.inc +++ b/third_party/python/Modules/_io/clinic/bufferedio.inc @@ -305,22 +305,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: @@ -492,4 +496,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=c1127ca3a3f57d06 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c526190c51a616c8 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/_io/clinic/bytesio.inc b/third_party/python/Modules/_io/clinic/bytesio.inc index 2d864a401..f83b30855 100644 --- a/third_party/python/Modules/_io/clinic/bytesio.inc +++ b/third_party/python/Modules/_io/clinic/bytesio.inc @@ -159,22 +159,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: @@ -204,22 +208,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: @@ -237,22 +245,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: @@ -304,22 +316,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: @@ -433,4 +449,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=2b2b78d39cdf6846 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=08139186b009ec47 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/_io/clinic/fileio.inc b/third_party/python/Modules/_io/clinic/fileio.inc index 013a1b44f..02400ba8b 100644 --- a/third_party/python/Modules/_io/clinic/fileio.inc +++ b/third_party/python/Modules/_io/clinic/fileio.inc @@ -337,22 +337,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: @@ -382,4 +386,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/third_party/python/Modules/_io/clinic/stringio.inc b/third_party/python/Modules/_io/clinic/stringio.inc index 5812471c0..4a3c497fb 100644 --- a/third_party/python/Modules/_io/clinic/stringio.inc +++ b/third_party/python/Modules/_io/clinic/stringio.inc @@ -49,22 +49,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: @@ -80,22 +84,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: @@ -113,22 +121,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: @@ -294,4 +306,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/third_party/python/Modules/_io/clinic/textio.inc b/third_party/python/Modules/_io/clinic/textio.inc index c044485a2..4f58dd268 100644 --- a/third_party/python/Modules/_io/clinic/textio.inc +++ b/third_party/python/Modules/_io/clinic/textio.inc @@ -337,22 +337,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: @@ -477,4 +481,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/third_party/python/Modules/clinic/_elementtree.inc b/third_party/python/Modules/clinic/_elementtree.inc index cad86ef0c..a62afe338 100644 --- a/third_party/python/Modules/clinic/_elementtree.inc +++ b/third_party/python/Modules/clinic/_elementtree.inc @@ -424,24 +424,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: @@ -480,24 +484,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: @@ -565,24 +573,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: @@ -652,25 +664,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: @@ -683,7 +699,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, @@ -691,20 +707,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/third_party/python/Modules/clinic/_gdbmmodule.inc b/third_party/python/Modules/clinic/_gdbmmodule.inc index 0a24a5000..985ea3fce 100644 --- a/third_party/python/Modules/clinic/_gdbmmodule.inc +++ b/third_party/python/Modules/clinic/_gdbmmodule.inc @@ -10,23 +10,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: @@ -40,24 +44,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: @@ -259,4 +267,4 @@ dbmopen(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) exit: return return_value; } -/*[clinic end generated code: output=16874d4acd7e7749 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d12de247acddccc3 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/_pickle.inc b/third_party/python/Modules/clinic/_pickle.inc index 4f16a3c1a..376cc540f 100644 --- a/third_party/python/Modules/clinic/_pickle.inc +++ b/third_party/python/Modules/clinic/_pickle.inc @@ -200,7 +200,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, @@ -208,17 +208,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: @@ -561,4 +565,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/third_party/python/Modules/clinic/_sre.inc b/third_party/python/Modules/clinic/_sre.inc index 23d99befe..b3c6e95d9 100644 --- a/third_party/python/Modules/clinic/_sre.inc +++ b/third_party/python/Modules/clinic/_sre.inc @@ -564,23 +564,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; @@ -598,23 +602,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; @@ -632,22 +640,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: @@ -733,4 +745,4 @@ _sre_SRE_Scanner_search(ScannerObject *self, PyObject *Py_UNUSED(ignored)) { return _sre_SRE_Scanner_search_impl(self); } -/*[clinic end generated code: output=b347a5bd7e21cfd4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ddfd6158e7ca39a3 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/audioop.inc b/third_party/python/Modules/clinic/audioop.inc index 6ba1172e9..89a2bf7b8 100644 --- a/third_party/python/Modules/clinic/audioop.inc +++ b/third_party/python/Modules/clinic/audioop.inc @@ -1,3 +1,4 @@ +/* clang-format off */ /*[clinic input] preserve [clinic start generated code]*/ diff --git a/third_party/python/Modules/clinic/signalmodule.inc b/third_party/python/Modules/clinic/signalmodule.inc index 3f09e022a..923b2c76d 100644 --- a/third_party/python/Modules/clinic/signalmodule.inc +++ b/third_party/python/Modules/clinic/signalmodule.inc @@ -354,24 +354,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: @@ -460,4 +464,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]*/ diff --git a/third_party/python/Objects/clinic/bytearrayobject.inc b/third_party/python/Objects/clinic/bytearrayobject.inc index 6e5d88b9a..9fdedd150 100644 --- a/third_party/python/Objects/clinic/bytearrayobject.inc +++ b/third_party/python/Objects/clinic/bytearrayobject.inc @@ -223,10 +223,10 @@ PyDoc_STRVAR(bytearray_partition__doc__, "\n" "This will search for the separator sep in the bytearray. If the separator is\n" "found, returns a 3-tuple containing the part before the separator, the\n" -"separator itself, and the part after it.\n" +"separator itself, and the part after it as new bytearray objects.\n" "\n" -"If the separator is not found, returns a 3-tuple containing the original\n" -"bytearray object and two empty bytearray objects."); +"If the separator is not found, returns a 3-tuple containing the copy of the\n" +"original bytearray object and two empty bytearray objects."); #define BYTEARRAY_PARTITION_METHODDEF \ {"partition", (PyCFunction)bytearray_partition, METH_O, bytearray_partition__doc__}, @@ -235,14 +235,15 @@ PyDoc_STRVAR(bytearray_rpartition__doc__, "rpartition($self, sep, /)\n" "--\n" "\n" -"Partition the bytes into three parts using the given separator.\n" +"Partition the bytearray into three parts using the given separator.\n" "\n" -"This will search for the separator sep in the bytearray, starting and the end.\n" +"This will search for the separator sep in the bytearray, starting at the end.\n" "If the separator is found, returns a 3-tuple containing the part before the\n" -"separator, the separator itself, and the part after it.\n" +"separator, the separator itself, and the part after it as new bytearray\n" +"objects.\n" "\n" "If the separator is not found, returns a 3-tuple containing two empty bytearray\n" -"objects and the original bytearray object."); +"objects and the copy of the original bytearray object."); #define BYTEARRAY_RPARTITION_METHODDEF \ {"rpartition", (PyCFunction)bytearray_rpartition, METH_O, bytearray_rpartition__doc__}, @@ -464,22 +465,26 @@ PyDoc_STRVAR(bytearray_strip__doc__, "If the argument is omitted or None, strip leading and trailing ASCII whitespace."); #define BYTEARRAY_STRIP_METHODDEF \ - {"strip", (PyCFunction)bytearray_strip, METH_VARARGS, bytearray_strip__doc__}, + {"strip", (PyCFunction)bytearray_strip, METH_FASTCALL, bytearray_strip__doc__}, static PyObject * bytearray_strip_impl(PyByteArrayObject *self, PyObject *bytes); static PyObject * -bytearray_strip(PyByteArrayObject *self, PyObject *args) +bytearray_strip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *bytes = Py_None; - if (!PyArg_UnpackTuple(args, "strip", + if (!_PyArg_UnpackStack(args, nargs, "strip", 0, 1, &bytes)) { goto exit; } + + if (!_PyArg_NoStackKeywords("strip", kwnames)) { + goto exit; + } return_value = bytearray_strip_impl(self, bytes); exit: @@ -495,22 +500,26 @@ PyDoc_STRVAR(bytearray_lstrip__doc__, "If the argument is omitted or None, strip leading ASCII whitespace."); #define BYTEARRAY_LSTRIP_METHODDEF \ - {"lstrip", (PyCFunction)bytearray_lstrip, METH_VARARGS, bytearray_lstrip__doc__}, + {"lstrip", (PyCFunction)bytearray_lstrip, METH_FASTCALL, bytearray_lstrip__doc__}, static PyObject * bytearray_lstrip_impl(PyByteArrayObject *self, PyObject *bytes); static PyObject * -bytearray_lstrip(PyByteArrayObject *self, PyObject *args) +bytearray_lstrip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *bytes = Py_None; - if (!PyArg_UnpackTuple(args, "lstrip", + if (!_PyArg_UnpackStack(args, nargs, "lstrip", 0, 1, &bytes)) { goto exit; } + + if (!_PyArg_NoStackKeywords("lstrip", kwnames)) { + goto exit; + } return_value = bytearray_lstrip_impl(self, bytes); exit: @@ -526,22 +535,26 @@ PyDoc_STRVAR(bytearray_rstrip__doc__, "If the argument is omitted or None, strip trailing ASCII whitespace."); #define BYTEARRAY_RSTRIP_METHODDEF \ - {"rstrip", (PyCFunction)bytearray_rstrip, METH_VARARGS, bytearray_rstrip__doc__}, + {"rstrip", (PyCFunction)bytearray_rstrip, METH_FASTCALL, bytearray_rstrip__doc__}, static PyObject * bytearray_rstrip_impl(PyByteArrayObject *self, PyObject *bytes); static PyObject * -bytearray_rstrip(PyByteArrayObject *self, PyObject *args) +bytearray_rstrip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *bytes = Py_None; - if (!PyArg_UnpackTuple(args, "rstrip", + if (!_PyArg_UnpackStack(args, nargs, "rstrip", 0, 1, &bytes)) { goto exit; } + + if (!_PyArg_NoStackKeywords("rstrip", kwnames)) { + goto exit; + } return_value = bytearray_rstrip_impl(self, bytes); exit: @@ -732,4 +745,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored)) { return bytearray_sizeof_impl(self); } -/*[clinic end generated code: output=e6c057d1cd7c2496 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c1b1b83b0e19df74 input=a9049054013a1b77]*/ diff --git a/third_party/python/Objects/clinic/bytesobject.inc b/third_party/python/Objects/clinic/bytesobject.inc index 56e98dc31..23db67445 100644 --- a/third_party/python/Objects/clinic/bytesobject.inc +++ b/third_party/python/Objects/clinic/bytesobject.inc @@ -87,7 +87,7 @@ PyDoc_STRVAR(bytes_rpartition__doc__, "\n" "Partition the bytes into three parts using the given separator.\n" "\n" -"This will search for the separator sep in the bytes, starting and the end. If\n" +"This will search for the separator sep in the bytes, starting at the end. If\n" "the separator is found, returns a 3-tuple containing the part before the\n" "separator, the separator itself, and the part after it.\n" "\n" @@ -185,22 +185,26 @@ PyDoc_STRVAR(bytes_strip__doc__, "If the argument is omitted or None, strip leading and trailing ASCII whitespace."); #define BYTES_STRIP_METHODDEF \ - {"strip", (PyCFunction)bytes_strip, METH_VARARGS, bytes_strip__doc__}, + {"strip", (PyCFunction)bytes_strip, METH_FASTCALL, bytes_strip__doc__}, static PyObject * bytes_strip_impl(PyBytesObject *self, PyObject *bytes); static PyObject * -bytes_strip(PyBytesObject *self, PyObject *args) +bytes_strip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *bytes = Py_None; - if (!PyArg_UnpackTuple(args, "strip", + if (!_PyArg_UnpackStack(args, nargs, "strip", 0, 1, &bytes)) { goto exit; } + + if (!_PyArg_NoStackKeywords("strip", kwnames)) { + goto exit; + } return_value = bytes_strip_impl(self, bytes); exit: @@ -216,22 +220,26 @@ PyDoc_STRVAR(bytes_lstrip__doc__, "If the argument is omitted or None, strip leading ASCII whitespace."); #define BYTES_LSTRIP_METHODDEF \ - {"lstrip", (PyCFunction)bytes_lstrip, METH_VARARGS, bytes_lstrip__doc__}, + {"lstrip", (PyCFunction)bytes_lstrip, METH_FASTCALL, bytes_lstrip__doc__}, static PyObject * bytes_lstrip_impl(PyBytesObject *self, PyObject *bytes); static PyObject * -bytes_lstrip(PyBytesObject *self, PyObject *args) +bytes_lstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *bytes = Py_None; - if (!PyArg_UnpackTuple(args, "lstrip", + if (!_PyArg_UnpackStack(args, nargs, "lstrip", 0, 1, &bytes)) { goto exit; } + + if (!_PyArg_NoStackKeywords("lstrip", kwnames)) { + goto exit; + } return_value = bytes_lstrip_impl(self, bytes); exit: @@ -247,22 +255,26 @@ PyDoc_STRVAR(bytes_rstrip__doc__, "If the argument is omitted or None, strip trailing ASCII whitespace."); #define BYTES_RSTRIP_METHODDEF \ - {"rstrip", (PyCFunction)bytes_rstrip, METH_VARARGS, bytes_rstrip__doc__}, + {"rstrip", (PyCFunction)bytes_rstrip, METH_FASTCALL, bytes_rstrip__doc__}, static PyObject * bytes_rstrip_impl(PyBytesObject *self, PyObject *bytes); static PyObject * -bytes_rstrip(PyBytesObject *self, PyObject *args) +bytes_rstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *bytes = Py_None; - if (!PyArg_UnpackTuple(args, "rstrip", + if (!_PyArg_UnpackStack(args, nargs, "rstrip", 0, 1, &bytes)) { goto exit; } + + if (!_PyArg_NoStackKeywords("rstrip", kwnames)) { + goto exit; + } return_value = bytes_rstrip_impl(self, bytes); exit: @@ -508,4 +520,4 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=2b8d3cff7e11045e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=debf785947e0eec2 input=a9049054013a1b77]*/ diff --git a/third_party/python/Objects/clinic/dictobject.inc b/third_party/python/Objects/clinic/dictobject.inc index 57932e69a..61be0d9d8 100644 --- a/third_party/python/Objects/clinic/dictobject.inc +++ b/third_party/python/Objects/clinic/dictobject.inc @@ -10,23 +10,27 @@ PyDoc_STRVAR(dict_fromkeys__doc__, "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: @@ -41,4 +45,4 @@ PyDoc_STRVAR(dict___contains____doc__, #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]*/ diff --git a/third_party/python/Objects/clinic/unicodeobject.inc b/third_party/python/Objects/clinic/unicodeobject.inc index 7d663b844..454e31452 100644 --- a/third_party/python/Objects/clinic/unicodeobject.inc +++ b/third_party/python/Objects/clinic/unicodeobject.inc @@ -1,11 +1,4 @@ -/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│ -╞══════════════════════════════════════════════════════════════════════════════╡ -│ Python 3 │ -│ https://docs.python.org/3/license.html │ -╚─────────────────────────────────────────────────────────────────────────────*/ /* clang-format off */ - /*[clinic input] preserve [clinic start generated code]*/ @@ -25,26 +18,30 @@ PyDoc_STRVAR(unicode_maketrans__doc__, "must be a string, whose characters will be mapped to None in the result."); #define UNICODE_MAKETRANS_METHODDEF \ - {"maketrans", (PyCFunction)unicode_maketrans, METH_VARARGS|METH_STATIC, unicode_maketrans__doc__}, + {"maketrans", (PyCFunction)unicode_maketrans, METH_FASTCALL|METH_STATIC, unicode_maketrans__doc__}, static PyObject * unicode_maketrans_impl(PyObject *x, PyObject *y, PyObject *z); static PyObject * -unicode_maketrans(void *null, PyObject *args) +unicode_maketrans(void *null, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *x; PyObject *y = NULL; PyObject *z = NULL; - if (!PyArg_ParseTuple(args, "O|UU:maketrans", + if (!_PyArg_ParseStack(args, nargs, "O|UU:maketrans", &x, &y, &z)) { goto exit; } + + if (!_PyArg_NoStackKeywords("maketrans", kwnames)) { + goto exit; + } return_value = unicode_maketrans_impl(x, y, z); exit: return return_value; } -/*[clinic end generated code: output=4a86dd108d92d104 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=af4804dbf21463b5 input=a9049054013a1b77]*/ diff --git a/third_party/python/Python/clinic/bltinmodule.inc b/third_party/python/Python/clinic/bltinmodule.inc index a5fbc7ed2..7802250ad 100644 --- a/third_party/python/Python/clinic/bltinmodule.inc +++ b/third_party/python/Python/clinic/bltinmodule.inc @@ -192,23 +192,27 @@ PyDoc_STRVAR(builtin_divmod__doc__, "Return the tuple (x//y, x%y). Invariant: div*y + mod == x."); #define BUILTIN_DIVMOD_METHODDEF \ - {"divmod", (PyCFunction)builtin_divmod, METH_VARARGS, builtin_divmod__doc__}, + {"divmod", (PyCFunction)builtin_divmod, METH_FASTCALL, builtin_divmod__doc__}, static PyObject * builtin_divmod_impl(PyObject *module, PyObject *x, PyObject *y); static PyObject * -builtin_divmod(PyObject *module, PyObject *args) +builtin_divmod(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *x; PyObject *y; - if (!PyArg_UnpackTuple(args, "divmod", + if (!_PyArg_UnpackStack(args, nargs, "divmod", 2, 2, &x, &y)) { goto exit; } + + if (!_PyArg_NoStackKeywords("divmod", kwnames)) { + goto exit; + } return_value = builtin_divmod_impl(module, x, y); exit: @@ -228,25 +232,29 @@ PyDoc_STRVAR(builtin_eval__doc__, "If only globals is given, locals defaults to it."); #define BUILTIN_EVAL_METHODDEF \ - {"eval", (PyCFunction)builtin_eval, METH_VARARGS, builtin_eval__doc__}, + {"eval", (PyCFunction)builtin_eval, METH_FASTCALL, builtin_eval__doc__}, static PyObject * builtin_eval_impl(PyObject *module, PyObject *source, PyObject *globals, PyObject *locals); static PyObject * -builtin_eval(PyObject *module, PyObject *args) +builtin_eval(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *source; PyObject *globals = Py_None; PyObject *locals = Py_None; - if (!PyArg_UnpackTuple(args, "eval", + if (!_PyArg_UnpackStack(args, nargs, "eval", 1, 3, &source, &globals, &locals)) { goto exit; } + + if (!_PyArg_NoStackKeywords("eval", kwnames)) { + goto exit; + } return_value = builtin_eval_impl(module, source, globals, locals); exit: @@ -266,25 +274,29 @@ PyDoc_STRVAR(builtin_exec__doc__, "If only globals is given, locals defaults to it."); #define BUILTIN_EXEC_METHODDEF \ - {"exec", (PyCFunction)builtin_exec, METH_VARARGS, builtin_exec__doc__}, + {"exec", (PyCFunction)builtin_exec, METH_FASTCALL, builtin_exec__doc__}, static PyObject * builtin_exec_impl(PyObject *module, PyObject *source, PyObject *globals, PyObject *locals); static PyObject * -builtin_exec(PyObject *module, PyObject *args) +builtin_exec(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *source; PyObject *globals = Py_None; PyObject *locals = Py_None; - if (!PyArg_UnpackTuple(args, "exec", + if (!_PyArg_UnpackStack(args, nargs, "exec", 1, 3, &source, &globals, &locals)) { goto exit; } + + if (!_PyArg_NoStackKeywords("exec", kwnames)) { + goto exit; + } return_value = builtin_exec_impl(module, source, globals, locals); exit: @@ -321,23 +333,27 @@ PyDoc_STRVAR(builtin_hasattr__doc__, "This is done by calling getattr(obj, name) and catching AttributeError."); #define BUILTIN_HASATTR_METHODDEF \ - {"hasattr", (PyCFunction)builtin_hasattr, METH_VARARGS, builtin_hasattr__doc__}, + {"hasattr", (PyCFunction)builtin_hasattr, METH_FASTCALL, builtin_hasattr__doc__}, static PyObject * builtin_hasattr_impl(PyObject *module, PyObject *obj, PyObject *name); static PyObject * -builtin_hasattr(PyObject *module, PyObject *args) +builtin_hasattr(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *obj; PyObject *name; - if (!PyArg_UnpackTuple(args, "hasattr", + if (!_PyArg_UnpackStack(args, nargs, "hasattr", 2, 2, &obj, &name)) { goto exit; } + + if (!_PyArg_NoStackKeywords("hasattr", kwnames)) { + goto exit; + } return_value = builtin_hasattr_impl(module, obj, name); exit: @@ -365,25 +381,29 @@ PyDoc_STRVAR(builtin_setattr__doc__, "setattr(x, \'y\', v) is equivalent to ``x.y = v\'\'"); #define BUILTIN_SETATTR_METHODDEF \ - {"setattr", (PyCFunction)builtin_setattr, METH_VARARGS, builtin_setattr__doc__}, + {"setattr", (PyCFunction)builtin_setattr, METH_FASTCALL, builtin_setattr__doc__}, static PyObject * builtin_setattr_impl(PyObject *module, PyObject *obj, PyObject *name, PyObject *value); static PyObject * -builtin_setattr(PyObject *module, PyObject *args) +builtin_setattr(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *obj; PyObject *name; PyObject *value; - if (!PyArg_UnpackTuple(args, "setattr", + if (!_PyArg_UnpackStack(args, nargs, "setattr", 3, 3, &obj, &name, &value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("setattr", kwnames)) { + goto exit; + } return_value = builtin_setattr_impl(module, obj, name, value); exit: @@ -399,23 +419,27 @@ PyDoc_STRVAR(builtin_delattr__doc__, "delattr(x, \'y\') is equivalent to ``del x.y\'\'"); #define BUILTIN_DELATTR_METHODDEF \ - {"delattr", (PyCFunction)builtin_delattr, METH_VARARGS, builtin_delattr__doc__}, + {"delattr", (PyCFunction)builtin_delattr, METH_FASTCALL, builtin_delattr__doc__}, static PyObject * builtin_delattr_impl(PyObject *module, PyObject *obj, PyObject *name); static PyObject * -builtin_delattr(PyObject *module, PyObject *args) +builtin_delattr(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *obj; PyObject *name; - if (!PyArg_UnpackTuple(args, "delattr", + if (!_PyArg_UnpackStack(args, nargs, "delattr", 2, 2, &obj, &name)) { goto exit; } + + if (!_PyArg_NoStackKeywords("delattr", kwnames)) { + goto exit; + } return_value = builtin_delattr_impl(module, obj, name); exit: @@ -508,24 +532,28 @@ PyDoc_STRVAR(builtin_pow__doc__, "invoked using the three argument form."); #define BUILTIN_POW_METHODDEF \ - {"pow", (PyCFunction)builtin_pow, METH_VARARGS, builtin_pow__doc__}, + {"pow", (PyCFunction)builtin_pow, METH_FASTCALL, builtin_pow__doc__}, static PyObject * builtin_pow_impl(PyObject *module, PyObject *x, PyObject *y, PyObject *z); static PyObject * -builtin_pow(PyObject *module, PyObject *args) +builtin_pow(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *x; PyObject *y; PyObject *z = Py_None; - if (!PyArg_UnpackTuple(args, "pow", + if (!_PyArg_UnpackStack(args, nargs, "pow", 2, 3, &x, &y, &z)) { goto exit; } + + if (!_PyArg_NoStackKeywords("pow", kwnames)) { + goto exit; + } return_value = builtin_pow_impl(module, x, y, z); exit: @@ -545,22 +573,26 @@ PyDoc_STRVAR(builtin_input__doc__, "On *nix systems, readline is used if available."); #define BUILTIN_INPUT_METHODDEF \ - {"input", (PyCFunction)builtin_input, METH_VARARGS, builtin_input__doc__}, + {"input", (PyCFunction)builtin_input, METH_FASTCALL, builtin_input__doc__}, static PyObject * builtin_input_impl(PyObject *module, PyObject *prompt); static PyObject * -builtin_input(PyObject *module, PyObject *args) +builtin_input(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *prompt = NULL; - if (!PyArg_UnpackTuple(args, "input", + if (!_PyArg_UnpackStack(args, nargs, "input", 0, 1, &prompt)) { goto exit; } + + if (!_PyArg_NoStackKeywords("input", kwnames)) { + goto exit; + } return_value = builtin_input_impl(module, prompt); exit: @@ -589,23 +621,27 @@ PyDoc_STRVAR(builtin_sum__doc__, "reject non-numeric types."); #define BUILTIN_SUM_METHODDEF \ - {"sum", (PyCFunction)builtin_sum, METH_VARARGS, builtin_sum__doc__}, + {"sum", (PyCFunction)builtin_sum, METH_FASTCALL, builtin_sum__doc__}, static PyObject * builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start); static PyObject * -builtin_sum(PyObject *module, PyObject *args) +builtin_sum(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *iterable; PyObject *start = NULL; - if (!PyArg_UnpackTuple(args, "sum", + if (!_PyArg_UnpackStack(args, nargs, "sum", 1, 2, &iterable, &start)) { goto exit; } + + if (!_PyArg_NoStackKeywords("sum", kwnames)) { + goto exit; + } return_value = builtin_sum_impl(module, iterable, start); exit: @@ -623,24 +659,28 @@ PyDoc_STRVAR(builtin_isinstance__doc__, "or ...`` etc."); #define BUILTIN_ISINSTANCE_METHODDEF \ - {"isinstance", (PyCFunction)builtin_isinstance, METH_VARARGS, builtin_isinstance__doc__}, + {"isinstance", (PyCFunction)builtin_isinstance, METH_FASTCALL, builtin_isinstance__doc__}, static PyObject * builtin_isinstance_impl(PyObject *module, PyObject *obj, PyObject *class_or_tuple); static PyObject * -builtin_isinstance(PyObject *module, PyObject *args) +builtin_isinstance(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *obj; PyObject *class_or_tuple; - if (!PyArg_UnpackTuple(args, "isinstance", + if (!_PyArg_UnpackStack(args, nargs, "isinstance", 2, 2, &obj, &class_or_tuple)) { goto exit; } + + if (!_PyArg_NoStackKeywords("isinstance", kwnames)) { + goto exit; + } return_value = builtin_isinstance_impl(module, obj, class_or_tuple); exit: @@ -658,27 +698,31 @@ PyDoc_STRVAR(builtin_issubclass__doc__, "or ...`` etc."); #define BUILTIN_ISSUBCLASS_METHODDEF \ - {"issubclass", (PyCFunction)builtin_issubclass, METH_VARARGS, builtin_issubclass__doc__}, + {"issubclass", (PyCFunction)builtin_issubclass, METH_FASTCALL, builtin_issubclass__doc__}, static PyObject * builtin_issubclass_impl(PyObject *module, PyObject *cls, PyObject *class_or_tuple); static PyObject * -builtin_issubclass(PyObject *module, PyObject *args) +builtin_issubclass(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *cls; PyObject *class_or_tuple; - if (!PyArg_UnpackTuple(args, "issubclass", + if (!_PyArg_UnpackStack(args, nargs, "issubclass", 2, 2, &cls, &class_or_tuple)) { goto exit; } + + if (!_PyArg_NoStackKeywords("issubclass", kwnames)) { + goto exit; + } return_value = builtin_issubclass_impl(module, cls, class_or_tuple); exit: return return_value; } -/*[clinic end generated code: output=c0201eb152977af0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=17fedd2dec148677 input=a9049054013a1b77]*/ diff --git a/third_party/python/Python/clinic/import.inc b/third_party/python/Python/clinic/import.inc index 714477903..9ae2dbff1 100644 --- a/third_party/python/Python/clinic/import.inc +++ b/third_party/python/Python/clinic/import.inc @@ -274,23 +274,27 @@ PyDoc_STRVAR(_imp_create_dynamic__doc__, "Create an extension module."); #define _IMP_CREATE_DYNAMIC_METHODDEF \ - {"create_dynamic", (PyCFunction)_imp_create_dynamic, METH_VARARGS, _imp_create_dynamic__doc__}, + {"create_dynamic", (PyCFunction)_imp_create_dynamic, METH_FASTCALL, _imp_create_dynamic__doc__}, static PyObject * _imp_create_dynamic_impl(PyObject *module, PyObject *spec, PyObject *file); static PyObject * -_imp_create_dynamic(PyObject *module, PyObject *args) +_imp_create_dynamic(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *spec; PyObject *file = NULL; - if (!PyArg_UnpackTuple(args, "create_dynamic", + if (!_PyArg_UnpackStack(args, nargs, "create_dynamic", 1, 2, &spec, &file)) { goto exit; } + + if (!_PyArg_NoStackKeywords("create_dynamic", kwnames)) { + goto exit; + } return_value = _imp_create_dynamic_impl(module, spec, file); exit: @@ -366,4 +370,4 @@ exit: #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=5a3f012344950548 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c1d0e65d04114958 input=a9049054013a1b77]*/