diff --git a/third_party/python/Modules/_io/clinic/_iomodule.inc b/third_party/python/Modules/_io/clinic/_iomodule.inc index 787258f96..00dfa598e 100644 --- a/third_party/python/Modules/_io/clinic/_iomodule.inc +++ b/third_party/python/Modules/_io/clinic/_iomodule.inc @@ -130,6 +130,11 @@ PyDoc_STRVAR(_io_open__doc__, #define _IO_OPEN_METHODDEF \ {"open", (PyCFunction)_io_open, METH_FASTCALL, _io_open__doc__}, +static PyObject * +_io_open_impl(PyObject *module, PyObject *file, const char *mode, + int buffering, const char *encoding, const char *errors, + const char *newline, int closefd, PyObject *opener); + static PyObject * _io_open(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { @@ -154,4 +159,4 @@ _io_open(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) exit: return return_value; } -/*[clinic end generated code: output=c5b8fc8b83102bbf input=a9049054013a1b77]*/ +/*[clinic end generated code: output=79fd04d9c9d8f28f input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/_io/clinic/bufferedio.inc b/third_party/python/Modules/_io/clinic/bufferedio.inc index d2c05e508..cb0a5f616 100644 --- a/third_party/python/Modules/_io/clinic/bufferedio.inc +++ b/third_party/python/Modules/_io/clinic/bufferedio.inc @@ -11,6 +11,8 @@ PyDoc_STRVAR(_io__BufferedIOBase_readinto__doc__, #define _IO__BUFFEREDIOBASE_READINTO_METHODDEF \ {"readinto", (PyCFunction)_io__BufferedIOBase_readinto, METH_O, _io__BufferedIOBase_readinto__doc__}, +static PyObject * +_io__BufferedIOBase_readinto_impl(PyObject *self, Py_buffer *buffer); static PyObject * _io__BufferedIOBase_readinto(PyObject *self, PyObject *arg) @@ -90,21 +92,25 @@ PyDoc_STRVAR(_io__Buffered_peek__doc__, "\n"); #define _IO__BUFFERED_PEEK_METHODDEF \ - {"peek", (PyCFunction)_io__Buffered_peek, METH_VARARGS, _io__Buffered_peek__doc__}, + {"peek", (PyCFunction)_io__Buffered_peek, METH_FASTCALL, _io__Buffered_peek__doc__}, static PyObject * _io__Buffered_peek_impl(buffered *self, Py_ssize_t size); static PyObject * -_io__Buffered_peek(buffered *self, PyObject *args) +_io__Buffered_peek(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t size = 0; - if (!PyArg_ParseTuple(args, "|n:peek", + if (!_PyArg_ParseStack(args, nargs, "|n:peek", &size)) { goto exit; } + + if (!_PyArg_NoStackKeywords("peek", kwnames)) { + goto exit; + } return_value = _io__Buffered_peek_impl(self, size); exit: @@ -117,21 +123,25 @@ PyDoc_STRVAR(_io__Buffered_read__doc__, "\n"); #define _IO__BUFFERED_READ_METHODDEF \ - {"read", (PyCFunction)_io__Buffered_read, METH_VARARGS, _io__Buffered_read__doc__}, + {"read", (PyCFunction)_io__Buffered_read, METH_FASTCALL, _io__Buffered_read__doc__}, static PyObject * _io__Buffered_read_impl(buffered *self, Py_ssize_t n); static PyObject * -_io__Buffered_read(buffered *self, PyObject *args) +_io__Buffered_read(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t n = -1; - if (!PyArg_ParseTuple(args, "|O&:read", + if (!_PyArg_ParseStack(args, nargs, "|O&:read", _PyIO_ConvertSsize_t, &n)) { goto exit; } + + if (!_PyArg_NoStackKeywords("read", kwnames)) { + goto exit; + } return_value = _io__Buffered_read_impl(self, n); exit: @@ -232,21 +242,25 @@ PyDoc_STRVAR(_io__Buffered_readline__doc__, "\n"); #define _IO__BUFFERED_READLINE_METHODDEF \ - {"readline", (PyCFunction)_io__Buffered_readline, METH_VARARGS, _io__Buffered_readline__doc__}, + {"readline", (PyCFunction)_io__Buffered_readline, METH_FASTCALL, _io__Buffered_readline__doc__}, static PyObject * _io__Buffered_readline_impl(buffered *self, Py_ssize_t size); static PyObject * -_io__Buffered_readline(buffered *self, PyObject *args) +_io__Buffered_readline(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t size = -1; - if (!PyArg_ParseTuple(args, "|O&:readline", + if (!_PyArg_ParseStack(args, nargs, "|O&:readline", _PyIO_ConvertSsize_t, &size)) { goto exit; } + + if (!_PyArg_NoStackKeywords("readline", kwnames)) { + goto exit; + } return_value = _io__Buffered_readline_impl(self, size); exit: @@ -259,22 +273,26 @@ PyDoc_STRVAR(_io__Buffered_seek__doc__, "\n"); #define _IO__BUFFERED_SEEK_METHODDEF \ - {"seek", (PyCFunction)_io__Buffered_seek, METH_VARARGS, _io__Buffered_seek__doc__}, + {"seek", (PyCFunction)_io__Buffered_seek, METH_FASTCALL, _io__Buffered_seek__doc__}, static PyObject * _io__Buffered_seek_impl(buffered *self, PyObject *targetobj, int whence); static PyObject * -_io__Buffered_seek(buffered *self, PyObject *args) +_io__Buffered_seek(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *targetobj; int whence = 0; - if (!PyArg_ParseTuple(args, "O|i:seek", + if (!_PyArg_ParseStack(args, nargs, "O|i:seek", &targetobj, &whence)) { goto exit; } + + if (!_PyArg_NoStackKeywords("seek", kwnames)) { + goto exit; + } return_value = _io__Buffered_seek_impl(self, targetobj, whence); exit: @@ -474,4 +492,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=a956f394ecde4cf9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c1127ca3a3f57d06 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/_io/clinic/bytesio.inc b/third_party/python/Modules/_io/clinic/bytesio.inc index 202e2b7a3..2d864a401 100644 --- a/third_party/python/Modules/_io/clinic/bytesio.inc +++ b/third_party/python/Modules/_io/clinic/bytesio.inc @@ -339,22 +339,26 @@ PyDoc_STRVAR(_io_BytesIO_seek__doc__, "Returns the new absolute position."); #define _IO_BYTESIO_SEEK_METHODDEF \ - {"seek", (PyCFunction)_io_BytesIO_seek, METH_VARARGS, _io_BytesIO_seek__doc__}, + {"seek", (PyCFunction)_io_BytesIO_seek, METH_FASTCALL, _io_BytesIO_seek__doc__}, static PyObject * _io_BytesIO_seek_impl(bytesio *self, Py_ssize_t pos, int whence); static PyObject * -_io_BytesIO_seek(bytesio *self, PyObject *args) +_io_BytesIO_seek(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t pos; int whence = 0; - if (!PyArg_ParseTuple(args, "n|i:seek", + if (!_PyArg_ParseStack(args, nargs, "n|i:seek", &pos, &whence)) { goto exit; } + + if (!_PyArg_NoStackKeywords("seek", kwnames)) { + goto exit; + } return_value = _io_BytesIO_seek_impl(self, pos, whence); exit: @@ -429,4 +433,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=6382e8eb578eea64 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2b2b78d39cdf6846 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/_io/clinic/fileio.inc b/third_party/python/Modules/_io/clinic/fileio.inc index 1f4346b6f..013a1b44f 100644 --- a/third_party/python/Modules/_io/clinic/fileio.inc +++ b/third_party/python/Modules/_io/clinic/fileio.inc @@ -15,6 +15,9 @@ PyDoc_STRVAR(_io_FileIO_close__doc__, #define _IO_FILEIO_CLOSE_METHODDEF \ {"close", (PyCFunction)_io_FileIO_close, METH_NOARGS, _io_FileIO_close__doc__}, +static PyObject * +_io_FileIO_close_impl(fileio *self); + static PyObject * _io_FileIO_close(fileio *self, PyObject *Py_UNUSED(ignored)) { @@ -39,6 +42,10 @@ PyDoc_STRVAR(_io_FileIO___init____doc__, "*opener* must return an open file descriptor (passing os.open as *opener*\n" "results in functionality similar to passing None)."); +static int +_io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode, + int closefd, PyObject *opener); + static int _io_FileIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -196,21 +203,25 @@ PyDoc_STRVAR(_io_FileIO_read__doc__, "Return an empty bytes object at EOF."); #define _IO_FILEIO_READ_METHODDEF \ - {"read", (PyCFunction)_io_FileIO_read, METH_VARARGS, _io_FileIO_read__doc__}, + {"read", (PyCFunction)_io_FileIO_read, METH_FASTCALL, _io_FileIO_read__doc__}, static PyObject * _io_FileIO_read_impl(fileio *self, Py_ssize_t size); static PyObject * -_io_FileIO_read(fileio *self, PyObject *args) +_io_FileIO_read(fileio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t size = -1; - if (!PyArg_ParseTuple(args, "|O&:read", + if (!_PyArg_ParseStack(args, nargs, "|O&:read", _PyIO_ConvertSsize_t, &size)) { goto exit; } + + if (!_PyArg_NoStackKeywords("read", kwnames)) { + goto exit; + } return_value = _io_FileIO_read_impl(self, size); exit: @@ -268,22 +279,26 @@ PyDoc_STRVAR(_io_FileIO_seek__doc__, "Note that not all file objects are seekable."); #define _IO_FILEIO_SEEK_METHODDEF \ - {"seek", (PyCFunction)_io_FileIO_seek, METH_VARARGS, _io_FileIO_seek__doc__}, + {"seek", (PyCFunction)_io_FileIO_seek, METH_FASTCALL, _io_FileIO_seek__doc__}, static PyObject * _io_FileIO_seek_impl(fileio *self, PyObject *pos, int whence); static PyObject * -_io_FileIO_seek(fileio *self, PyObject *args) +_io_FileIO_seek(fileio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *pos; int whence = 0; - if (!PyArg_ParseTuple(args, "O|i:seek", + if (!_PyArg_ParseStack(args, nargs, "O|i:seek", &pos, &whence)) { goto exit; } + + if (!_PyArg_NoStackKeywords("seek", kwnames)) { + goto exit; + } return_value = _io_FileIO_seek_impl(self, pos, whence); exit: @@ -367,4 +382,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=51924bc0ee11d58e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5c2a0b493c0af58b input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/_io/clinic/iobase.inc b/third_party/python/Modules/_io/clinic/iobase.inc index 1123041aa..33c999f08 100644 --- a/third_party/python/Modules/_io/clinic/iobase.inc +++ b/third_party/python/Modules/_io/clinic/iobase.inc @@ -12,6 +12,9 @@ PyDoc_STRVAR(_io__IOBase_tell__doc__, #define _IO__IOBASE_TELL_METHODDEF \ {"tell", (PyCFunction)_io__IOBase_tell, METH_NOARGS, _io__IOBase_tell__doc__}, +static PyObject * +_io__IOBase_tell_impl(PyObject *self); + static PyObject * _io__IOBase_tell(PyObject *self, PyObject *Py_UNUSED(ignored)) { @@ -29,6 +32,9 @@ PyDoc_STRVAR(_io__IOBase_flush__doc__, #define _IO__IOBASE_FLUSH_METHODDEF \ {"flush", (PyCFunction)_io__IOBase_flush, METH_NOARGS, _io__IOBase_flush__doc__}, +static PyObject * +_io__IOBase_flush_impl(PyObject *self); + static PyObject * _io__IOBase_flush(PyObject *self, PyObject *Py_UNUSED(ignored)) { @@ -46,6 +52,9 @@ PyDoc_STRVAR(_io__IOBase_close__doc__, #define _IO__IOBASE_CLOSE_METHODDEF \ {"close", (PyCFunction)_io__IOBase_close, METH_NOARGS, _io__IOBase_close__doc__}, +static PyObject * +_io__IOBase_close_impl(PyObject *self); + static PyObject * _io__IOBase_close(PyObject *self, PyObject *Py_UNUSED(ignored)) { @@ -64,6 +73,9 @@ PyDoc_STRVAR(_io__IOBase_seekable__doc__, #define _IO__IOBASE_SEEKABLE_METHODDEF \ {"seekable", (PyCFunction)_io__IOBase_seekable, METH_NOARGS, _io__IOBase_seekable__doc__}, +static PyObject * +_io__IOBase_seekable_impl(PyObject *self); + static PyObject * _io__IOBase_seekable(PyObject *self, PyObject *Py_UNUSED(ignored)) { @@ -81,6 +93,9 @@ PyDoc_STRVAR(_io__IOBase_readable__doc__, #define _IO__IOBASE_READABLE_METHODDEF \ {"readable", (PyCFunction)_io__IOBase_readable, METH_NOARGS, _io__IOBase_readable__doc__}, +static PyObject * +_io__IOBase_readable_impl(PyObject *self); + static PyObject * _io__IOBase_readable(PyObject *self, PyObject *Py_UNUSED(ignored)) { @@ -98,6 +113,9 @@ PyDoc_STRVAR(_io__IOBase_writable__doc__, #define _IO__IOBASE_WRITABLE_METHODDEF \ {"writable", (PyCFunction)_io__IOBase_writable, METH_NOARGS, _io__IOBase_writable__doc__}, +static PyObject * +_io__IOBase_writable_impl(PyObject *self); + static PyObject * _io__IOBase_writable(PyObject *self, PyObject *Py_UNUSED(ignored)) { @@ -115,6 +133,9 @@ PyDoc_STRVAR(_io__IOBase_fileno__doc__, #define _IO__IOBASE_FILENO_METHODDEF \ {"fileno", (PyCFunction)_io__IOBase_fileno, METH_NOARGS, _io__IOBase_fileno__doc__}, +static PyObject * +_io__IOBase_fileno_impl(PyObject *self); + static PyObject * _io__IOBase_fileno(PyObject *self, PyObject *Py_UNUSED(ignored)) { @@ -132,6 +153,9 @@ PyDoc_STRVAR(_io__IOBase_isatty__doc__, #define _IO__IOBASE_ISATTY_METHODDEF \ {"isatty", (PyCFunction)_io__IOBase_isatty, METH_NOARGS, _io__IOBase_isatty__doc__}, +static PyObject * +_io__IOBase_isatty_impl(PyObject *self); + static PyObject * _io__IOBase_isatty(PyObject *self, PyObject *Py_UNUSED(ignored)) { @@ -151,18 +175,25 @@ PyDoc_STRVAR(_io__IOBase_readline__doc__, "terminator(s) recognized."); #define _IO__IOBASE_READLINE_METHODDEF \ - {"readline", (PyCFunction)_io__IOBase_readline, METH_VARARGS, _io__IOBase_readline__doc__}, + {"readline", (PyCFunction)_io__IOBase_readline, METH_FASTCALL, _io__IOBase_readline__doc__}, static PyObject * -_io__IOBase_readline(PyObject *self, PyObject *args) +_io__IOBase_readline_impl(PyObject *self, Py_ssize_t limit); + +static PyObject * +_io__IOBase_readline(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t limit = -1; - if (!PyArg_ParseTuple(args, "|O&:readline", + if (!_PyArg_ParseStack(args, nargs, "|O&:readline", _PyIO_ConvertSsize_t, &limit)) { goto exit; } + + if (!_PyArg_NoStackKeywords("readline", kwnames)) { + goto exit; + } return_value = _io__IOBase_readline_impl(self, limit); exit: @@ -180,18 +211,25 @@ PyDoc_STRVAR(_io__IOBase_readlines__doc__, "lines so far exceeds hint."); #define _IO__IOBASE_READLINES_METHODDEF \ - {"readlines", (PyCFunction)_io__IOBase_readlines, METH_VARARGS, _io__IOBase_readlines__doc__}, + {"readlines", (PyCFunction)_io__IOBase_readlines, METH_FASTCALL, _io__IOBase_readlines__doc__}, static PyObject * -_io__IOBase_readlines(PyObject *self, PyObject *args) +_io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint); + +static PyObject * +_io__IOBase_readlines(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t hint = -1; - if (!PyArg_ParseTuple(args, "|O&:readlines", + if (!_PyArg_ParseStack(args, nargs, "|O&:readlines", _PyIO_ConvertSsize_t, &hint)) { goto exit; } + + if (!_PyArg_NoStackKeywords("readlines", kwnames)) { + goto exit; + } return_value = _io__IOBase_readlines_impl(self, hint); exit: @@ -212,21 +250,25 @@ PyDoc_STRVAR(_io__RawIOBase_read__doc__, "\n"); #define _IO__RAWIOBASE_READ_METHODDEF \ - {"read", (PyCFunction)_io__RawIOBase_read, METH_VARARGS, _io__RawIOBase_read__doc__}, + {"read", (PyCFunction)_io__RawIOBase_read, METH_FASTCALL, _io__RawIOBase_read__doc__}, static PyObject * _io__RawIOBase_read_impl(PyObject *self, Py_ssize_t n); static PyObject * -_io__RawIOBase_read(PyObject *self, PyObject *args) +_io__RawIOBase_read(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t n = -1; - if (!PyArg_ParseTuple(args, "|n:read", + if (!_PyArg_ParseStack(args, nargs, "|n:read", &n)) { goto exit; } + + if (!_PyArg_NoStackKeywords("read", kwnames)) { + goto exit; + } return_value = _io__RawIOBase_read_impl(self, n); exit: @@ -250,4 +292,4 @@ _io__RawIOBase_readall(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _io__RawIOBase_readall_impl(self); } -/*[clinic end generated code: output=0f53fed928d8e02f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1bcece367fc7b0cd input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/_io/clinic/stringio.inc b/third_party/python/Modules/_io/clinic/stringio.inc index 54d623638..5812471c0 100644 --- a/third_party/python/Modules/_io/clinic/stringio.inc +++ b/third_party/python/Modules/_io/clinic/stringio.inc @@ -12,6 +12,9 @@ PyDoc_STRVAR(_io_StringIO_getvalue__doc__, #define _IO_STRINGIO_GETVALUE_METHODDEF \ {"getvalue", (PyCFunction)_io_StringIO_getvalue, METH_NOARGS, _io_StringIO_getvalue__doc__}, +static PyObject * +_io_StringIO_getvalue_impl(stringio *self); + static PyObject * _io_StringIO_getvalue(stringio *self, PyObject *Py_UNUSED(ignored)) { @@ -145,22 +148,26 @@ PyDoc_STRVAR(_io_StringIO_seek__doc__, "Returns the new absolute position."); #define _IO_STRINGIO_SEEK_METHODDEF \ - {"seek", (PyCFunction)_io_StringIO_seek, METH_VARARGS, _io_StringIO_seek__doc__}, + {"seek", (PyCFunction)_io_StringIO_seek, METH_FASTCALL, _io_StringIO_seek__doc__}, static PyObject * _io_StringIO_seek_impl(stringio *self, Py_ssize_t pos, int whence); static PyObject * -_io_StringIO_seek(stringio *self, PyObject *args) +_io_StringIO_seek(stringio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t pos; int whence = 0; - if (!PyArg_ParseTuple(args, "n|i:seek", + if (!_PyArg_ParseStack(args, nargs, "n|i:seek", &pos, &whence)) { goto exit; } + + if (!_PyArg_NoStackKeywords("seek", kwnames)) { + goto exit; + } return_value = _io_StringIO_seek_impl(self, pos, whence); exit: @@ -287,4 +294,4 @@ _io_StringIO_seekable(stringio *self, PyObject *Py_UNUSED(ignored)) { return _io_StringIO_seekable_impl(self); } -/*[clinic end generated code: output=5dd5c2a213e75405 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=69bf262268745061 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/_io/clinic/textio.inc b/third_party/python/Modules/_io/clinic/textio.inc index 039adabc2..c044485a2 100644 --- a/third_party/python/Modules/_io/clinic/textio.inc +++ b/third_party/python/Modules/_io/clinic/textio.inc @@ -1,9 +1,3 @@ -/*-*- 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 @@ -232,21 +226,25 @@ PyDoc_STRVAR(_io_TextIOWrapper_read__doc__, "\n"); #define _IO_TEXTIOWRAPPER_READ_METHODDEF \ - {"read", (PyCFunction)_io_TextIOWrapper_read, METH_VARARGS, _io_TextIOWrapper_read__doc__}, + {"read", (PyCFunction)_io_TextIOWrapper_read, METH_FASTCALL, _io_TextIOWrapper_read__doc__}, static PyObject * _io_TextIOWrapper_read_impl(textio *self, Py_ssize_t n); static PyObject * -_io_TextIOWrapper_read(textio *self, PyObject *args) +_io_TextIOWrapper_read(textio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t n = -1; - if (!PyArg_ParseTuple(args, "|O&:read", + if (!_PyArg_ParseStack(args, nargs, "|O&:read", _PyIO_ConvertSsize_t, &n)) { goto exit; } + + if (!_PyArg_NoStackKeywords("read", kwnames)) { + goto exit; + } return_value = _io_TextIOWrapper_read_impl(self, n); exit: @@ -259,21 +257,25 @@ PyDoc_STRVAR(_io_TextIOWrapper_readline__doc__, "\n"); #define _IO_TEXTIOWRAPPER_READLINE_METHODDEF \ - {"readline", (PyCFunction)_io_TextIOWrapper_readline, METH_VARARGS, _io_TextIOWrapper_readline__doc__}, + {"readline", (PyCFunction)_io_TextIOWrapper_readline, METH_FASTCALL, _io_TextIOWrapper_readline__doc__}, static PyObject * _io_TextIOWrapper_readline_impl(textio *self, Py_ssize_t size); static PyObject * -_io_TextIOWrapper_readline(textio *self, PyObject *args) +_io_TextIOWrapper_readline(textio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t size = -1; - if (!PyArg_ParseTuple(args, "|n:readline", + if (!_PyArg_ParseStack(args, nargs, "|n:readline", &size)) { goto exit; } + + if (!_PyArg_NoStackKeywords("readline", kwnames)) { + goto exit; + } return_value = _io_TextIOWrapper_readline_impl(self, size); exit: @@ -286,22 +288,26 @@ PyDoc_STRVAR(_io_TextIOWrapper_seek__doc__, "\n"); #define _IO_TEXTIOWRAPPER_SEEK_METHODDEF \ - {"seek", (PyCFunction)_io_TextIOWrapper_seek, METH_VARARGS, _io_TextIOWrapper_seek__doc__}, + {"seek", (PyCFunction)_io_TextIOWrapper_seek, METH_FASTCALL, _io_TextIOWrapper_seek__doc__}, static PyObject * _io_TextIOWrapper_seek_impl(textio *self, PyObject *cookieObj, int whence); static PyObject * -_io_TextIOWrapper_seek(textio *self, PyObject *args) +_io_TextIOWrapper_seek(textio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *cookieObj; int whence = 0; - if (!PyArg_ParseTuple(args, "O|i:seek", + if (!_PyArg_ParseStack(args, nargs, "O|i:seek", &cookieObj, &whence)) { goto exit; } + + if (!_PyArg_NoStackKeywords("seek", kwnames)) { + goto exit; + } return_value = _io_TextIOWrapper_seek_impl(self, cookieObj, whence); exit: @@ -471,4 +477,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored)) { return _io_TextIOWrapper_close_impl(self); } -/*[clinic end generated code: output=78ad14eba1667254 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1f8367c7a3301670 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/_io/clinic/winconsoleio.inc b/third_party/python/Modules/_io/clinic/winconsoleio.inc index 842ee272c..0cec0141d 100644 --- a/third_party/python/Modules/_io/clinic/winconsoleio.inc +++ b/third_party/python/Modules/_io/clinic/winconsoleio.inc @@ -3,8 +3,6 @@ preserve [clinic start generated code]*/ -#if defined(MS_WINDOWS) - PyDoc_STRVAR(_io__WindowsConsoleIO_close__doc__, "close($self, /)\n" "--\n" @@ -26,10 +24,6 @@ _io__WindowsConsoleIO_close(winconsoleio *self, PyObject *Py_UNUSED(ignored)) return _io__WindowsConsoleIO_close_impl(self); } -#endif /* defined(MS_WINDOWS) */ - -#if defined(MS_WINDOWS) - PyDoc_STRVAR(_io__WindowsConsoleIO___init____doc__, "_WindowsConsoleIO(file, mode=\'r\', closefd=True, opener=None)\n" "--\n" @@ -66,10 +60,6 @@ exit: return return_value; } -#endif /* defined(MS_WINDOWS) */ - -#if defined(MS_WINDOWS) - PyDoc_STRVAR(_io__WindowsConsoleIO_fileno__doc__, "fileno($self, /)\n" "--\n" @@ -91,10 +81,6 @@ _io__WindowsConsoleIO_fileno(winconsoleio *self, PyObject *Py_UNUSED(ignored)) return _io__WindowsConsoleIO_fileno_impl(self); } -#endif /* defined(MS_WINDOWS) */ - -#if defined(MS_WINDOWS) - PyDoc_STRVAR(_io__WindowsConsoleIO_readable__doc__, "readable($self, /)\n" "--\n" @@ -113,10 +99,6 @@ _io__WindowsConsoleIO_readable(winconsoleio *self, PyObject *Py_UNUSED(ignored)) return _io__WindowsConsoleIO_readable_impl(self); } -#endif /* defined(MS_WINDOWS) */ - -#if defined(MS_WINDOWS) - PyDoc_STRVAR(_io__WindowsConsoleIO_writable__doc__, "writable($self, /)\n" "--\n" @@ -135,10 +117,6 @@ _io__WindowsConsoleIO_writable(winconsoleio *self, PyObject *Py_UNUSED(ignored)) return _io__WindowsConsoleIO_writable_impl(self); } -#endif /* defined(MS_WINDOWS) */ - -#if defined(MS_WINDOWS) - PyDoc_STRVAR(_io__WindowsConsoleIO_readinto__doc__, "readinto($self, buffer, /)\n" "--\n" @@ -171,10 +149,6 @@ exit: return return_value; } -#endif /* defined(MS_WINDOWS) */ - -#if defined(MS_WINDOWS) - PyDoc_STRVAR(_io__WindowsConsoleIO_readall__doc__, "readall($self, /)\n" "--\n" @@ -195,10 +169,6 @@ _io__WindowsConsoleIO_readall(winconsoleio *self, PyObject *Py_UNUSED(ignored)) return _io__WindowsConsoleIO_readall_impl(self); } -#endif /* defined(MS_WINDOWS) */ - -#if defined(MS_WINDOWS) - PyDoc_STRVAR(_io__WindowsConsoleIO_read__doc__, "read($self, size=-1, /)\n" "--\n" @@ -210,31 +180,31 @@ PyDoc_STRVAR(_io__WindowsConsoleIO_read__doc__, "Return an empty bytes object at EOF."); #define _IO__WINDOWSCONSOLEIO_READ_METHODDEF \ - {"read", (PyCFunction)_io__WindowsConsoleIO_read, METH_VARARGS, _io__WindowsConsoleIO_read__doc__}, + {"read", (PyCFunction)_io__WindowsConsoleIO_read, METH_FASTCALL, _io__WindowsConsoleIO_read__doc__}, static PyObject * _io__WindowsConsoleIO_read_impl(winconsoleio *self, Py_ssize_t size); static PyObject * -_io__WindowsConsoleIO_read(winconsoleio *self, PyObject *args) +_io__WindowsConsoleIO_read(winconsoleio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t size = -1; - if (!PyArg_ParseTuple(args, "|O&:read", + if (!_PyArg_ParseStack(args, nargs, "|O&:read", _PyIO_ConvertSsize_t, &size)) { goto exit; } + + if (!_PyArg_NoStackKeywords("read", kwnames)) { + goto exit; + } return_value = _io__WindowsConsoleIO_read_impl(self, size); exit: return return_value; } -#endif /* defined(MS_WINDOWS) */ - -#if defined(MS_WINDOWS) - PyDoc_STRVAR(_io__WindowsConsoleIO_write__doc__, "write($self, b, /)\n" "--\n" @@ -270,10 +240,6 @@ exit: return return_value; } -#endif /* defined(MS_WINDOWS) */ - -#if defined(MS_WINDOWS) - PyDoc_STRVAR(_io__WindowsConsoleIO_isatty__doc__, "isatty($self, /)\n" "--\n" @@ -291,42 +257,4 @@ _io__WindowsConsoleIO_isatty(winconsoleio *self, PyObject *Py_UNUSED(ignored)) { return _io__WindowsConsoleIO_isatty_impl(self); } - -#endif /* defined(MS_WINDOWS) */ - -#ifndef _IO__WINDOWSCONSOLEIO_CLOSE_METHODDEF - #define _IO__WINDOWSCONSOLEIO_CLOSE_METHODDEF -#endif /* !defined(_IO__WINDOWSCONSOLEIO_CLOSE_METHODDEF) */ - -#ifndef _IO__WINDOWSCONSOLEIO_FILENO_METHODDEF - #define _IO__WINDOWSCONSOLEIO_FILENO_METHODDEF -#endif /* !defined(_IO__WINDOWSCONSOLEIO_FILENO_METHODDEF) */ - -#ifndef _IO__WINDOWSCONSOLEIO_READABLE_METHODDEF - #define _IO__WINDOWSCONSOLEIO_READABLE_METHODDEF -#endif /* !defined(_IO__WINDOWSCONSOLEIO_READABLE_METHODDEF) */ - -#ifndef _IO__WINDOWSCONSOLEIO_WRITABLE_METHODDEF - #define _IO__WINDOWSCONSOLEIO_WRITABLE_METHODDEF -#endif /* !defined(_IO__WINDOWSCONSOLEIO_WRITABLE_METHODDEF) */ - -#ifndef _IO__WINDOWSCONSOLEIO_READINTO_METHODDEF - #define _IO__WINDOWSCONSOLEIO_READINTO_METHODDEF -#endif /* !defined(_IO__WINDOWSCONSOLEIO_READINTO_METHODDEF) */ - -#ifndef _IO__WINDOWSCONSOLEIO_READALL_METHODDEF - #define _IO__WINDOWSCONSOLEIO_READALL_METHODDEF -#endif /* !defined(_IO__WINDOWSCONSOLEIO_READALL_METHODDEF) */ - -#ifndef _IO__WINDOWSCONSOLEIO_READ_METHODDEF - #define _IO__WINDOWSCONSOLEIO_READ_METHODDEF -#endif /* !defined(_IO__WINDOWSCONSOLEIO_READ_METHODDEF) */ - -#ifndef _IO__WINDOWSCONSOLEIO_WRITE_METHODDEF - #define _IO__WINDOWSCONSOLEIO_WRITE_METHODDEF -#endif /* !defined(_IO__WINDOWSCONSOLEIO_WRITE_METHODDEF) */ - -#ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF - #define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF -#endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */ -/*[clinic end generated code: output=9eba916f8537fff7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b097ceeb54d6e15e input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/_io/winconsoleio.c b/third_party/python/Modules/_io/winconsoleio.c index 35d974cbb..6e08d18ce 100644 --- a/third_party/python/Modules/_io/winconsoleio.c +++ b/third_party/python/Modules/_io/winconsoleio.c @@ -1179,5 +1179,3 @@ PyTypeObject PyWindowsConsoleIO_Type = { }; PyAPI_DATA(PyObject *) _PyWindowsConsoleIO_Type = (PyObject*)&PyWindowsConsoleIO_Type; - -#endif /* MS_WINDOWS */ diff --git a/third_party/python/Modules/audioop.c b/third_party/python/Modules/audioop.c index 107bf7b2e..8a2ee56bb 100644 --- a/third_party/python/Modules/audioop.c +++ b/third_party/python/Modules/audioop.c @@ -7,6 +7,7 @@ #define PY_SSIZE_T_CLEAN #include "dsp/core/core.h" #include "libc/math.h" +#include "third_party/python/Include/abstract.h" #include "third_party/python/Include/dictobject.h" #include "third_party/python/Include/floatobject.h" #include "third_party/python/Include/import.h" diff --git a/third_party/python/Modules/clinic/_asynciomodule.inc b/third_party/python/Modules/clinic/_asynciomodule.inc index 806f42139..64881d791 100644 --- a/third_party/python/Modules/clinic/_asynciomodule.inc +++ b/third_party/python/Modules/clinic/_asynciomodule.inc @@ -518,4 +518,4 @@ _asyncio_Task__wakeup(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObject exit: return return_value; } -/*[clinic end generated code: output=7441872b13652085 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1f2f5bbc35bc3c4e input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/_bz2module.inc b/third_party/python/Modules/clinic/_bz2module.inc index 0a43cb79f..06e2d7d6a 100644 --- a/third_party/python/Modules/clinic/_bz2module.inc +++ b/third_party/python/Modules/clinic/_bz2module.inc @@ -175,4 +175,4 @@ _bz2_BZ2Decompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=7e57af0b368d3e55 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0e97a1d716b35a14 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/_codecsmodule.inc b/third_party/python/Modules/clinic/_codecsmodule.inc index 909722487..64b1557e0 100644 --- a/third_party/python/Modules/clinic/_codecsmodule.inc +++ b/third_party/python/Modules/clinic/_codecsmodule.inc @@ -154,23 +154,27 @@ PyDoc_STRVAR(_codecs_escape_decode__doc__, "\n"); #define _CODECS_ESCAPE_DECODE_METHODDEF \ - {"escape_decode", (PyCFunction)_codecs_escape_decode, METH_VARARGS, _codecs_escape_decode__doc__}, + {"escape_decode", (PyCFunction)_codecs_escape_decode, METH_FASTCALL, _codecs_escape_decode__doc__}, static PyObject * _codecs_escape_decode_impl(PyObject *module, Py_buffer *data, const char *errors); static PyObject * -_codecs_escape_decode(PyObject *module, PyObject *args) +_codecs_escape_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "s*|z:escape_decode", + if (!_PyArg_ParseStack(args, nargs, "s*|z:escape_decode", &data, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("escape_decode", kwnames)) { + goto exit; + } return_value = _codecs_escape_decode_impl(module, &data, errors); exit: @@ -188,23 +192,27 @@ PyDoc_STRVAR(_codecs_escape_encode__doc__, "\n"); #define _CODECS_ESCAPE_ENCODE_METHODDEF \ - {"escape_encode", (PyCFunction)_codecs_escape_encode, METH_VARARGS, _codecs_escape_encode__doc__}, + {"escape_encode", (PyCFunction)_codecs_escape_encode, METH_FASTCALL, _codecs_escape_encode__doc__}, static PyObject * _codecs_escape_encode_impl(PyObject *module, PyObject *data, const char *errors); static PyObject * -_codecs_escape_encode(PyObject *module, PyObject *args) +_codecs_escape_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *data; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "O!|z:escape_encode", + if (!_PyArg_ParseStack(args, nargs, "O!|z:escape_encode", &PyBytes_Type, &data, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("escape_encode", kwnames)) { + goto exit; + } return_value = _codecs_escape_encode_impl(module, data, errors); exit: @@ -217,23 +225,27 @@ PyDoc_STRVAR(_codecs_unicode_internal_decode__doc__, "\n"); #define _CODECS_UNICODE_INTERNAL_DECODE_METHODDEF \ - {"unicode_internal_decode", (PyCFunction)_codecs_unicode_internal_decode, METH_VARARGS, _codecs_unicode_internal_decode__doc__}, + {"unicode_internal_decode", (PyCFunction)_codecs_unicode_internal_decode, METH_FASTCALL, _codecs_unicode_internal_decode__doc__}, static PyObject * _codecs_unicode_internal_decode_impl(PyObject *module, PyObject *obj, const char *errors); static PyObject * -_codecs_unicode_internal_decode(PyObject *module, PyObject *args) +_codecs_unicode_internal_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *obj; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "O|z:unicode_internal_decode", + if (!_PyArg_ParseStack(args, nargs, "O|z:unicode_internal_decode", &obj, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("unicode_internal_decode", kwnames)) { + goto exit; + } return_value = _codecs_unicode_internal_decode_impl(module, obj, errors); exit: @@ -246,24 +258,28 @@ PyDoc_STRVAR(_codecs_utf_7_decode__doc__, "\n"); #define _CODECS_UTF_7_DECODE_METHODDEF \ - {"utf_7_decode", (PyCFunction)_codecs_utf_7_decode, METH_VARARGS, _codecs_utf_7_decode__doc__}, + {"utf_7_decode", (PyCFunction)_codecs_utf_7_decode, METH_FASTCALL, _codecs_utf_7_decode__doc__}, static PyObject * _codecs_utf_7_decode_impl(PyObject *module, Py_buffer *data, const char *errors, int final); static PyObject * -_codecs_utf_7_decode(PyObject *module, PyObject *args) +_codecs_utf_7_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; int final = 0; - if (!PyArg_ParseTuple(args, "y*|zi:utf_7_decode", + if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_7_decode", &data, &errors, &final)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_7_decode", kwnames)) { + goto exit; + } return_value = _codecs_utf_7_decode_impl(module, &data, errors, final); exit: @@ -281,24 +297,28 @@ PyDoc_STRVAR(_codecs_utf_8_decode__doc__, "\n"); #define _CODECS_UTF_8_DECODE_METHODDEF \ - {"utf_8_decode", (PyCFunction)_codecs_utf_8_decode, METH_VARARGS, _codecs_utf_8_decode__doc__}, + {"utf_8_decode", (PyCFunction)_codecs_utf_8_decode, METH_FASTCALL, _codecs_utf_8_decode__doc__}, static PyObject * _codecs_utf_8_decode_impl(PyObject *module, Py_buffer *data, const char *errors, int final); static PyObject * -_codecs_utf_8_decode(PyObject *module, PyObject *args) +_codecs_utf_8_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; int final = 0; - if (!PyArg_ParseTuple(args, "y*|zi:utf_8_decode", + if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_8_decode", &data, &errors, &final)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_8_decode", kwnames)) { + goto exit; + } return_value = _codecs_utf_8_decode_impl(module, &data, errors, final); exit: @@ -316,24 +336,28 @@ PyDoc_STRVAR(_codecs_utf_16_decode__doc__, "\n"); #define _CODECS_UTF_16_DECODE_METHODDEF \ - {"utf_16_decode", (PyCFunction)_codecs_utf_16_decode, METH_VARARGS, _codecs_utf_16_decode__doc__}, + {"utf_16_decode", (PyCFunction)_codecs_utf_16_decode, METH_FASTCALL, _codecs_utf_16_decode__doc__}, static PyObject * _codecs_utf_16_decode_impl(PyObject *module, Py_buffer *data, const char *errors, int final); static PyObject * -_codecs_utf_16_decode(PyObject *module, PyObject *args) +_codecs_utf_16_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; int final = 0; - if (!PyArg_ParseTuple(args, "y*|zi:utf_16_decode", + if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_16_decode", &data, &errors, &final)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_16_decode", kwnames)) { + goto exit; + } return_value = _codecs_utf_16_decode_impl(module, &data, errors, final); exit: @@ -351,24 +375,28 @@ PyDoc_STRVAR(_codecs_utf_16_le_decode__doc__, "\n"); #define _CODECS_UTF_16_LE_DECODE_METHODDEF \ - {"utf_16_le_decode", (PyCFunction)_codecs_utf_16_le_decode, METH_VARARGS, _codecs_utf_16_le_decode__doc__}, + {"utf_16_le_decode", (PyCFunction)_codecs_utf_16_le_decode, METH_FASTCALL, _codecs_utf_16_le_decode__doc__}, static PyObject * _codecs_utf_16_le_decode_impl(PyObject *module, Py_buffer *data, const char *errors, int final); static PyObject * -_codecs_utf_16_le_decode(PyObject *module, PyObject *args) +_codecs_utf_16_le_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; int final = 0; - if (!PyArg_ParseTuple(args, "y*|zi:utf_16_le_decode", + if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_16_le_decode", &data, &errors, &final)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_16_le_decode", kwnames)) { + goto exit; + } return_value = _codecs_utf_16_le_decode_impl(module, &data, errors, final); exit: @@ -386,24 +414,28 @@ PyDoc_STRVAR(_codecs_utf_16_be_decode__doc__, "\n"); #define _CODECS_UTF_16_BE_DECODE_METHODDEF \ - {"utf_16_be_decode", (PyCFunction)_codecs_utf_16_be_decode, METH_VARARGS, _codecs_utf_16_be_decode__doc__}, + {"utf_16_be_decode", (PyCFunction)_codecs_utf_16_be_decode, METH_FASTCALL, _codecs_utf_16_be_decode__doc__}, static PyObject * _codecs_utf_16_be_decode_impl(PyObject *module, Py_buffer *data, const char *errors, int final); static PyObject * -_codecs_utf_16_be_decode(PyObject *module, PyObject *args) +_codecs_utf_16_be_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; int final = 0; - if (!PyArg_ParseTuple(args, "y*|zi:utf_16_be_decode", + if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_16_be_decode", &data, &errors, &final)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_16_be_decode", kwnames)) { + goto exit; + } return_value = _codecs_utf_16_be_decode_impl(module, &data, errors, final); exit: @@ -422,14 +454,14 @@ PyDoc_STRVAR(_codecs_utf_16_ex_decode__doc__, "\n"); #define _CODECS_UTF_16_EX_DECODE_METHODDEF \ - {"utf_16_ex_decode", (PyCFunction)_codecs_utf_16_ex_decode, METH_VARARGS, _codecs_utf_16_ex_decode__doc__}, + {"utf_16_ex_decode", (PyCFunction)_codecs_utf_16_ex_decode, METH_FASTCALL, _codecs_utf_16_ex_decode__doc__}, static PyObject * _codecs_utf_16_ex_decode_impl(PyObject *module, Py_buffer *data, const char *errors, int byteorder, int final); static PyObject * -_codecs_utf_16_ex_decode(PyObject *module, PyObject *args) +_codecs_utf_16_ex_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; @@ -437,10 +469,14 @@ _codecs_utf_16_ex_decode(PyObject *module, PyObject *args) int byteorder = 0; int final = 0; - if (!PyArg_ParseTuple(args, "y*|zii:utf_16_ex_decode", + if (!_PyArg_ParseStack(args, nargs, "y*|zii:utf_16_ex_decode", &data, &errors, &byteorder, &final)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_16_ex_decode", kwnames)) { + goto exit; + } return_value = _codecs_utf_16_ex_decode_impl(module, &data, errors, byteorder, final); exit: @@ -458,24 +494,28 @@ PyDoc_STRVAR(_codecs_utf_32_decode__doc__, "\n"); #define _CODECS_UTF_32_DECODE_METHODDEF \ - {"utf_32_decode", (PyCFunction)_codecs_utf_32_decode, METH_VARARGS, _codecs_utf_32_decode__doc__}, + {"utf_32_decode", (PyCFunction)_codecs_utf_32_decode, METH_FASTCALL, _codecs_utf_32_decode__doc__}, static PyObject * _codecs_utf_32_decode_impl(PyObject *module, Py_buffer *data, const char *errors, int final); static PyObject * -_codecs_utf_32_decode(PyObject *module, PyObject *args) +_codecs_utf_32_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; int final = 0; - if (!PyArg_ParseTuple(args, "y*|zi:utf_32_decode", + if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_32_decode", &data, &errors, &final)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_32_decode", kwnames)) { + goto exit; + } return_value = _codecs_utf_32_decode_impl(module, &data, errors, final); exit: @@ -493,24 +533,28 @@ PyDoc_STRVAR(_codecs_utf_32_le_decode__doc__, "\n"); #define _CODECS_UTF_32_LE_DECODE_METHODDEF \ - {"utf_32_le_decode", (PyCFunction)_codecs_utf_32_le_decode, METH_VARARGS, _codecs_utf_32_le_decode__doc__}, + {"utf_32_le_decode", (PyCFunction)_codecs_utf_32_le_decode, METH_FASTCALL, _codecs_utf_32_le_decode__doc__}, static PyObject * _codecs_utf_32_le_decode_impl(PyObject *module, Py_buffer *data, const char *errors, int final); static PyObject * -_codecs_utf_32_le_decode(PyObject *module, PyObject *args) +_codecs_utf_32_le_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; int final = 0; - if (!PyArg_ParseTuple(args, "y*|zi:utf_32_le_decode", + if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_32_le_decode", &data, &errors, &final)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_32_le_decode", kwnames)) { + goto exit; + } return_value = _codecs_utf_32_le_decode_impl(module, &data, errors, final); exit: @@ -528,24 +572,28 @@ PyDoc_STRVAR(_codecs_utf_32_be_decode__doc__, "\n"); #define _CODECS_UTF_32_BE_DECODE_METHODDEF \ - {"utf_32_be_decode", (PyCFunction)_codecs_utf_32_be_decode, METH_VARARGS, _codecs_utf_32_be_decode__doc__}, + {"utf_32_be_decode", (PyCFunction)_codecs_utf_32_be_decode, METH_FASTCALL, _codecs_utf_32_be_decode__doc__}, static PyObject * _codecs_utf_32_be_decode_impl(PyObject *module, Py_buffer *data, const char *errors, int final); static PyObject * -_codecs_utf_32_be_decode(PyObject *module, PyObject *args) +_codecs_utf_32_be_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; int final = 0; - if (!PyArg_ParseTuple(args, "y*|zi:utf_32_be_decode", + if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_32_be_decode", &data, &errors, &final)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_32_be_decode", kwnames)) { + goto exit; + } return_value = _codecs_utf_32_be_decode_impl(module, &data, errors, final); exit: @@ -564,14 +612,14 @@ PyDoc_STRVAR(_codecs_utf_32_ex_decode__doc__, "\n"); #define _CODECS_UTF_32_EX_DECODE_METHODDEF \ - {"utf_32_ex_decode", (PyCFunction)_codecs_utf_32_ex_decode, METH_VARARGS, _codecs_utf_32_ex_decode__doc__}, + {"utf_32_ex_decode", (PyCFunction)_codecs_utf_32_ex_decode, METH_FASTCALL, _codecs_utf_32_ex_decode__doc__}, static PyObject * _codecs_utf_32_ex_decode_impl(PyObject *module, Py_buffer *data, const char *errors, int byteorder, int final); static PyObject * -_codecs_utf_32_ex_decode(PyObject *module, PyObject *args) +_codecs_utf_32_ex_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; @@ -579,10 +627,14 @@ _codecs_utf_32_ex_decode(PyObject *module, PyObject *args) int byteorder = 0; int final = 0; - if (!PyArg_ParseTuple(args, "y*|zii:utf_32_ex_decode", + if (!_PyArg_ParseStack(args, nargs, "y*|zii:utf_32_ex_decode", &data, &errors, &byteorder, &final)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_32_ex_decode", kwnames)) { + goto exit; + } return_value = _codecs_utf_32_ex_decode_impl(module, &data, errors, byteorder, final); exit: @@ -600,23 +652,27 @@ PyDoc_STRVAR(_codecs_unicode_escape_decode__doc__, "\n"); #define _CODECS_UNICODE_ESCAPE_DECODE_METHODDEF \ - {"unicode_escape_decode", (PyCFunction)_codecs_unicode_escape_decode, METH_VARARGS, _codecs_unicode_escape_decode__doc__}, + {"unicode_escape_decode", (PyCFunction)_codecs_unicode_escape_decode, METH_FASTCALL, _codecs_unicode_escape_decode__doc__}, static PyObject * _codecs_unicode_escape_decode_impl(PyObject *module, Py_buffer *data, const char *errors); static PyObject * -_codecs_unicode_escape_decode(PyObject *module, PyObject *args) +_codecs_unicode_escape_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "s*|z:unicode_escape_decode", + if (!_PyArg_ParseStack(args, nargs, "s*|z:unicode_escape_decode", &data, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("unicode_escape_decode", kwnames)) { + goto exit; + } return_value = _codecs_unicode_escape_decode_impl(module, &data, errors); exit: @@ -634,23 +690,27 @@ PyDoc_STRVAR(_codecs_raw_unicode_escape_decode__doc__, "\n"); #define _CODECS_RAW_UNICODE_ESCAPE_DECODE_METHODDEF \ - {"raw_unicode_escape_decode", (PyCFunction)_codecs_raw_unicode_escape_decode, METH_VARARGS, _codecs_raw_unicode_escape_decode__doc__}, + {"raw_unicode_escape_decode", (PyCFunction)_codecs_raw_unicode_escape_decode, METH_FASTCALL, _codecs_raw_unicode_escape_decode__doc__}, static PyObject * _codecs_raw_unicode_escape_decode_impl(PyObject *module, Py_buffer *data, const char *errors); static PyObject * -_codecs_raw_unicode_escape_decode(PyObject *module, PyObject *args) +_codecs_raw_unicode_escape_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "s*|z:raw_unicode_escape_decode", + if (!_PyArg_ParseStack(args, nargs, "s*|z:raw_unicode_escape_decode", &data, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("raw_unicode_escape_decode", kwnames)) { + goto exit; + } return_value = _codecs_raw_unicode_escape_decode_impl(module, &data, errors); exit: @@ -668,23 +728,27 @@ PyDoc_STRVAR(_codecs_latin_1_decode__doc__, "\n"); #define _CODECS_LATIN_1_DECODE_METHODDEF \ - {"latin_1_decode", (PyCFunction)_codecs_latin_1_decode, METH_VARARGS, _codecs_latin_1_decode__doc__}, + {"latin_1_decode", (PyCFunction)_codecs_latin_1_decode, METH_FASTCALL, _codecs_latin_1_decode__doc__}, static PyObject * _codecs_latin_1_decode_impl(PyObject *module, Py_buffer *data, const char *errors); static PyObject * -_codecs_latin_1_decode(PyObject *module, PyObject *args) +_codecs_latin_1_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "y*|z:latin_1_decode", + if (!_PyArg_ParseStack(args, nargs, "y*|z:latin_1_decode", &data, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("latin_1_decode", kwnames)) { + goto exit; + } return_value = _codecs_latin_1_decode_impl(module, &data, errors); exit: @@ -702,23 +766,27 @@ PyDoc_STRVAR(_codecs_ascii_decode__doc__, "\n"); #define _CODECS_ASCII_DECODE_METHODDEF \ - {"ascii_decode", (PyCFunction)_codecs_ascii_decode, METH_VARARGS, _codecs_ascii_decode__doc__}, + {"ascii_decode", (PyCFunction)_codecs_ascii_decode, METH_FASTCALL, _codecs_ascii_decode__doc__}, static PyObject * _codecs_ascii_decode_impl(PyObject *module, Py_buffer *data, const char *errors); static PyObject * -_codecs_ascii_decode(PyObject *module, PyObject *args) +_codecs_ascii_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "y*|z:ascii_decode", + if (!_PyArg_ParseStack(args, nargs, "y*|z:ascii_decode", &data, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("ascii_decode", kwnames)) { + goto exit; + } return_value = _codecs_ascii_decode_impl(module, &data, errors); exit: @@ -736,24 +804,28 @@ PyDoc_STRVAR(_codecs_charmap_decode__doc__, "\n"); #define _CODECS_CHARMAP_DECODE_METHODDEF \ - {"charmap_decode", (PyCFunction)_codecs_charmap_decode, METH_VARARGS, _codecs_charmap_decode__doc__}, + {"charmap_decode", (PyCFunction)_codecs_charmap_decode, METH_FASTCALL, _codecs_charmap_decode__doc__}, static PyObject * _codecs_charmap_decode_impl(PyObject *module, Py_buffer *data, const char *errors, PyObject *mapping); static PyObject * -_codecs_charmap_decode(PyObject *module, PyObject *args) +_codecs_charmap_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; PyObject *mapping = NULL; - if (!PyArg_ParseTuple(args, "y*|zO:charmap_decode", + if (!_PyArg_ParseStack(args, nargs, "y*|zO:charmap_decode", &data, &errors, &mapping)) { goto exit; } + + if (!_PyArg_NoStackKeywords("charmap_decode", kwnames)) { + goto exit; + } return_value = _codecs_charmap_decode_impl(module, &data, errors, mapping); exit: @@ -773,24 +845,28 @@ PyDoc_STRVAR(_codecs_mbcs_decode__doc__, "\n"); #define _CODECS_MBCS_DECODE_METHODDEF \ - {"mbcs_decode", (PyCFunction)_codecs_mbcs_decode, METH_VARARGS, _codecs_mbcs_decode__doc__}, + {"mbcs_decode", (PyCFunction)_codecs_mbcs_decode, METH_FASTCALL, _codecs_mbcs_decode__doc__}, static PyObject * _codecs_mbcs_decode_impl(PyObject *module, Py_buffer *data, const char *errors, int final); static PyObject * -_codecs_mbcs_decode(PyObject *module, PyObject *args) +_codecs_mbcs_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; int final = 0; - if (!PyArg_ParseTuple(args, "y*|zi:mbcs_decode", + if (!_PyArg_ParseStack(args, nargs, "y*|zi:mbcs_decode", &data, &errors, &final)) { goto exit; } + + if (!_PyArg_NoStackKeywords("mbcs_decode", kwnames)) { + goto exit; + } return_value = _codecs_mbcs_decode_impl(module, &data, errors, final); exit: @@ -812,24 +888,28 @@ PyDoc_STRVAR(_codecs_oem_decode__doc__, "\n"); #define _CODECS_OEM_DECODE_METHODDEF \ - {"oem_decode", (PyCFunction)_codecs_oem_decode, METH_VARARGS, _codecs_oem_decode__doc__}, + {"oem_decode", (PyCFunction)_codecs_oem_decode, METH_FASTCALL, _codecs_oem_decode__doc__}, static PyObject * _codecs_oem_decode_impl(PyObject *module, Py_buffer *data, const char *errors, int final); static PyObject * -_codecs_oem_decode(PyObject *module, PyObject *args) +_codecs_oem_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; int final = 0; - if (!PyArg_ParseTuple(args, "y*|zi:oem_decode", + if (!_PyArg_ParseStack(args, nargs, "y*|zi:oem_decode", &data, &errors, &final)) { goto exit; } + + if (!_PyArg_NoStackKeywords("oem_decode", kwnames)) { + goto exit; + } return_value = _codecs_oem_decode_impl(module, &data, errors, final); exit: @@ -851,14 +931,14 @@ PyDoc_STRVAR(_codecs_code_page_decode__doc__, "\n"); #define _CODECS_CODE_PAGE_DECODE_METHODDEF \ - {"code_page_decode", (PyCFunction)_codecs_code_page_decode, METH_VARARGS, _codecs_code_page_decode__doc__}, + {"code_page_decode", (PyCFunction)_codecs_code_page_decode, METH_FASTCALL, _codecs_code_page_decode__doc__}, static PyObject * _codecs_code_page_decode_impl(PyObject *module, int codepage, Py_buffer *data, const char *errors, int final); static PyObject * -_codecs_code_page_decode(PyObject *module, PyObject *args) +_codecs_code_page_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int codepage; @@ -866,10 +946,14 @@ _codecs_code_page_decode(PyObject *module, PyObject *args) const char *errors = NULL; int final = 0; - if (!PyArg_ParseTuple(args, "iy*|zi:code_page_decode", + if (!_PyArg_ParseStack(args, nargs, "iy*|zi:code_page_decode", &codepage, &data, &errors, &final)) { goto exit; } + + if (!_PyArg_NoStackKeywords("code_page_decode", kwnames)) { + goto exit; + } return_value = _codecs_code_page_decode_impl(module, codepage, &data, errors, final); exit: @@ -889,23 +973,27 @@ PyDoc_STRVAR(_codecs_readbuffer_encode__doc__, "\n"); #define _CODECS_READBUFFER_ENCODE_METHODDEF \ - {"readbuffer_encode", (PyCFunction)_codecs_readbuffer_encode, METH_VARARGS, _codecs_readbuffer_encode__doc__}, + {"readbuffer_encode", (PyCFunction)_codecs_readbuffer_encode, METH_FASTCALL, _codecs_readbuffer_encode__doc__}, static PyObject * _codecs_readbuffer_encode_impl(PyObject *module, Py_buffer *data, const char *errors); static PyObject * -_codecs_readbuffer_encode(PyObject *module, PyObject *args) +_codecs_readbuffer_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "s*|z:readbuffer_encode", + if (!_PyArg_ParseStack(args, nargs, "s*|z:readbuffer_encode", &data, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("readbuffer_encode", kwnames)) { + goto exit; + } return_value = _codecs_readbuffer_encode_impl(module, &data, errors); exit: @@ -923,23 +1011,27 @@ PyDoc_STRVAR(_codecs_unicode_internal_encode__doc__, "\n"); #define _CODECS_UNICODE_INTERNAL_ENCODE_METHODDEF \ - {"unicode_internal_encode", (PyCFunction)_codecs_unicode_internal_encode, METH_VARARGS, _codecs_unicode_internal_encode__doc__}, + {"unicode_internal_encode", (PyCFunction)_codecs_unicode_internal_encode, METH_FASTCALL, _codecs_unicode_internal_encode__doc__}, static PyObject * _codecs_unicode_internal_encode_impl(PyObject *module, PyObject *obj, const char *errors); static PyObject * -_codecs_unicode_internal_encode(PyObject *module, PyObject *args) +_codecs_unicode_internal_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *obj; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "O|z:unicode_internal_encode", + if (!_PyArg_ParseStack(args, nargs, "O|z:unicode_internal_encode", &obj, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("unicode_internal_encode", kwnames)) { + goto exit; + } return_value = _codecs_unicode_internal_encode_impl(module, obj, errors); exit: @@ -952,23 +1044,27 @@ PyDoc_STRVAR(_codecs_utf_7_encode__doc__, "\n"); #define _CODECS_UTF_7_ENCODE_METHODDEF \ - {"utf_7_encode", (PyCFunction)_codecs_utf_7_encode, METH_VARARGS, _codecs_utf_7_encode__doc__}, + {"utf_7_encode", (PyCFunction)_codecs_utf_7_encode, METH_FASTCALL, _codecs_utf_7_encode__doc__}, static PyObject * _codecs_utf_7_encode_impl(PyObject *module, PyObject *str, const char *errors); static PyObject * -_codecs_utf_7_encode(PyObject *module, PyObject *args) +_codecs_utf_7_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *str; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "U|z:utf_7_encode", + if (!_PyArg_ParseStack(args, nargs, "U|z:utf_7_encode", &str, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_7_encode", kwnames)) { + goto exit; + } return_value = _codecs_utf_7_encode_impl(module, str, errors); exit: @@ -981,23 +1077,27 @@ PyDoc_STRVAR(_codecs_utf_8_encode__doc__, "\n"); #define _CODECS_UTF_8_ENCODE_METHODDEF \ - {"utf_8_encode", (PyCFunction)_codecs_utf_8_encode, METH_VARARGS, _codecs_utf_8_encode__doc__}, + {"utf_8_encode", (PyCFunction)_codecs_utf_8_encode, METH_FASTCALL, _codecs_utf_8_encode__doc__}, static PyObject * _codecs_utf_8_encode_impl(PyObject *module, PyObject *str, const char *errors); static PyObject * -_codecs_utf_8_encode(PyObject *module, PyObject *args) +_codecs_utf_8_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *str; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "U|z:utf_8_encode", + if (!_PyArg_ParseStack(args, nargs, "U|z:utf_8_encode", &str, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_8_encode", kwnames)) { + goto exit; + } return_value = _codecs_utf_8_encode_impl(module, str, errors); exit: @@ -1010,24 +1110,28 @@ PyDoc_STRVAR(_codecs_utf_16_encode__doc__, "\n"); #define _CODECS_UTF_16_ENCODE_METHODDEF \ - {"utf_16_encode", (PyCFunction)_codecs_utf_16_encode, METH_VARARGS, _codecs_utf_16_encode__doc__}, + {"utf_16_encode", (PyCFunction)_codecs_utf_16_encode, METH_FASTCALL, _codecs_utf_16_encode__doc__}, static PyObject * _codecs_utf_16_encode_impl(PyObject *module, PyObject *str, const char *errors, int byteorder); static PyObject * -_codecs_utf_16_encode(PyObject *module, PyObject *args) +_codecs_utf_16_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *str; const char *errors = NULL; int byteorder = 0; - if (!PyArg_ParseTuple(args, "U|zi:utf_16_encode", + if (!_PyArg_ParseStack(args, nargs, "U|zi:utf_16_encode", &str, &errors, &byteorder)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_16_encode", kwnames)) { + goto exit; + } return_value = _codecs_utf_16_encode_impl(module, str, errors, byteorder); exit: @@ -1040,23 +1144,27 @@ PyDoc_STRVAR(_codecs_utf_16_le_encode__doc__, "\n"); #define _CODECS_UTF_16_LE_ENCODE_METHODDEF \ - {"utf_16_le_encode", (PyCFunction)_codecs_utf_16_le_encode, METH_VARARGS, _codecs_utf_16_le_encode__doc__}, + {"utf_16_le_encode", (PyCFunction)_codecs_utf_16_le_encode, METH_FASTCALL, _codecs_utf_16_le_encode__doc__}, static PyObject * _codecs_utf_16_le_encode_impl(PyObject *module, PyObject *str, const char *errors); static PyObject * -_codecs_utf_16_le_encode(PyObject *module, PyObject *args) +_codecs_utf_16_le_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *str; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "U|z:utf_16_le_encode", + if (!_PyArg_ParseStack(args, nargs, "U|z:utf_16_le_encode", &str, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_16_le_encode", kwnames)) { + goto exit; + } return_value = _codecs_utf_16_le_encode_impl(module, str, errors); exit: @@ -1069,23 +1177,27 @@ PyDoc_STRVAR(_codecs_utf_16_be_encode__doc__, "\n"); #define _CODECS_UTF_16_BE_ENCODE_METHODDEF \ - {"utf_16_be_encode", (PyCFunction)_codecs_utf_16_be_encode, METH_VARARGS, _codecs_utf_16_be_encode__doc__}, + {"utf_16_be_encode", (PyCFunction)_codecs_utf_16_be_encode, METH_FASTCALL, _codecs_utf_16_be_encode__doc__}, static PyObject * _codecs_utf_16_be_encode_impl(PyObject *module, PyObject *str, const char *errors); static PyObject * -_codecs_utf_16_be_encode(PyObject *module, PyObject *args) +_codecs_utf_16_be_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *str; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "U|z:utf_16_be_encode", + if (!_PyArg_ParseStack(args, nargs, "U|z:utf_16_be_encode", &str, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_16_be_encode", kwnames)) { + goto exit; + } return_value = _codecs_utf_16_be_encode_impl(module, str, errors); exit: @@ -1098,24 +1210,28 @@ PyDoc_STRVAR(_codecs_utf_32_encode__doc__, "\n"); #define _CODECS_UTF_32_ENCODE_METHODDEF \ - {"utf_32_encode", (PyCFunction)_codecs_utf_32_encode, METH_VARARGS, _codecs_utf_32_encode__doc__}, + {"utf_32_encode", (PyCFunction)_codecs_utf_32_encode, METH_FASTCALL, _codecs_utf_32_encode__doc__}, static PyObject * _codecs_utf_32_encode_impl(PyObject *module, PyObject *str, const char *errors, int byteorder); static PyObject * -_codecs_utf_32_encode(PyObject *module, PyObject *args) +_codecs_utf_32_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *str; const char *errors = NULL; int byteorder = 0; - if (!PyArg_ParseTuple(args, "U|zi:utf_32_encode", + if (!_PyArg_ParseStack(args, nargs, "U|zi:utf_32_encode", &str, &errors, &byteorder)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_32_encode", kwnames)) { + goto exit; + } return_value = _codecs_utf_32_encode_impl(module, str, errors, byteorder); exit: @@ -1128,23 +1244,27 @@ PyDoc_STRVAR(_codecs_utf_32_le_encode__doc__, "\n"); #define _CODECS_UTF_32_LE_ENCODE_METHODDEF \ - {"utf_32_le_encode", (PyCFunction)_codecs_utf_32_le_encode, METH_VARARGS, _codecs_utf_32_le_encode__doc__}, + {"utf_32_le_encode", (PyCFunction)_codecs_utf_32_le_encode, METH_FASTCALL, _codecs_utf_32_le_encode__doc__}, static PyObject * _codecs_utf_32_le_encode_impl(PyObject *module, PyObject *str, const char *errors); static PyObject * -_codecs_utf_32_le_encode(PyObject *module, PyObject *args) +_codecs_utf_32_le_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *str; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "U|z:utf_32_le_encode", + if (!_PyArg_ParseStack(args, nargs, "U|z:utf_32_le_encode", &str, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_32_le_encode", kwnames)) { + goto exit; + } return_value = _codecs_utf_32_le_encode_impl(module, str, errors); exit: @@ -1157,23 +1277,27 @@ PyDoc_STRVAR(_codecs_utf_32_be_encode__doc__, "\n"); #define _CODECS_UTF_32_BE_ENCODE_METHODDEF \ - {"utf_32_be_encode", (PyCFunction)_codecs_utf_32_be_encode, METH_VARARGS, _codecs_utf_32_be_encode__doc__}, + {"utf_32_be_encode", (PyCFunction)_codecs_utf_32_be_encode, METH_FASTCALL, _codecs_utf_32_be_encode__doc__}, static PyObject * _codecs_utf_32_be_encode_impl(PyObject *module, PyObject *str, const char *errors); static PyObject * -_codecs_utf_32_be_encode(PyObject *module, PyObject *args) +_codecs_utf_32_be_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *str; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "U|z:utf_32_be_encode", + if (!_PyArg_ParseStack(args, nargs, "U|z:utf_32_be_encode", &str, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("utf_32_be_encode", kwnames)) { + goto exit; + } return_value = _codecs_utf_32_be_encode_impl(module, str, errors); exit: @@ -1186,23 +1310,27 @@ PyDoc_STRVAR(_codecs_unicode_escape_encode__doc__, "\n"); #define _CODECS_UNICODE_ESCAPE_ENCODE_METHODDEF \ - {"unicode_escape_encode", (PyCFunction)_codecs_unicode_escape_encode, METH_VARARGS, _codecs_unicode_escape_encode__doc__}, + {"unicode_escape_encode", (PyCFunction)_codecs_unicode_escape_encode, METH_FASTCALL, _codecs_unicode_escape_encode__doc__}, static PyObject * _codecs_unicode_escape_encode_impl(PyObject *module, PyObject *str, const char *errors); static PyObject * -_codecs_unicode_escape_encode(PyObject *module, PyObject *args) +_codecs_unicode_escape_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *str; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "U|z:unicode_escape_encode", + if (!_PyArg_ParseStack(args, nargs, "U|z:unicode_escape_encode", &str, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("unicode_escape_encode", kwnames)) { + goto exit; + } return_value = _codecs_unicode_escape_encode_impl(module, str, errors); exit: @@ -1215,23 +1343,27 @@ PyDoc_STRVAR(_codecs_raw_unicode_escape_encode__doc__, "\n"); #define _CODECS_RAW_UNICODE_ESCAPE_ENCODE_METHODDEF \ - {"raw_unicode_escape_encode", (PyCFunction)_codecs_raw_unicode_escape_encode, METH_VARARGS, _codecs_raw_unicode_escape_encode__doc__}, + {"raw_unicode_escape_encode", (PyCFunction)_codecs_raw_unicode_escape_encode, METH_FASTCALL, _codecs_raw_unicode_escape_encode__doc__}, static PyObject * _codecs_raw_unicode_escape_encode_impl(PyObject *module, PyObject *str, const char *errors); static PyObject * -_codecs_raw_unicode_escape_encode(PyObject *module, PyObject *args) +_codecs_raw_unicode_escape_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *str; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "U|z:raw_unicode_escape_encode", + if (!_PyArg_ParseStack(args, nargs, "U|z:raw_unicode_escape_encode", &str, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("raw_unicode_escape_encode", kwnames)) { + goto exit; + } return_value = _codecs_raw_unicode_escape_encode_impl(module, str, errors); exit: @@ -1244,23 +1376,27 @@ PyDoc_STRVAR(_codecs_latin_1_encode__doc__, "\n"); #define _CODECS_LATIN_1_ENCODE_METHODDEF \ - {"latin_1_encode", (PyCFunction)_codecs_latin_1_encode, METH_VARARGS, _codecs_latin_1_encode__doc__}, + {"latin_1_encode", (PyCFunction)_codecs_latin_1_encode, METH_FASTCALL, _codecs_latin_1_encode__doc__}, static PyObject * _codecs_latin_1_encode_impl(PyObject *module, PyObject *str, const char *errors); static PyObject * -_codecs_latin_1_encode(PyObject *module, PyObject *args) +_codecs_latin_1_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *str; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "U|z:latin_1_encode", + if (!_PyArg_ParseStack(args, nargs, "U|z:latin_1_encode", &str, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("latin_1_encode", kwnames)) { + goto exit; + } return_value = _codecs_latin_1_encode_impl(module, str, errors); exit: @@ -1273,23 +1409,27 @@ PyDoc_STRVAR(_codecs_ascii_encode__doc__, "\n"); #define _CODECS_ASCII_ENCODE_METHODDEF \ - {"ascii_encode", (PyCFunction)_codecs_ascii_encode, METH_VARARGS, _codecs_ascii_encode__doc__}, + {"ascii_encode", (PyCFunction)_codecs_ascii_encode, METH_FASTCALL, _codecs_ascii_encode__doc__}, static PyObject * _codecs_ascii_encode_impl(PyObject *module, PyObject *str, const char *errors); static PyObject * -_codecs_ascii_encode(PyObject *module, PyObject *args) +_codecs_ascii_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *str; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "U|z:ascii_encode", + if (!_PyArg_ParseStack(args, nargs, "U|z:ascii_encode", &str, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("ascii_encode", kwnames)) { + goto exit; + } return_value = _codecs_ascii_encode_impl(module, str, errors); exit: @@ -1302,24 +1442,28 @@ PyDoc_STRVAR(_codecs_charmap_encode__doc__, "\n"); #define _CODECS_CHARMAP_ENCODE_METHODDEF \ - {"charmap_encode", (PyCFunction)_codecs_charmap_encode, METH_VARARGS, _codecs_charmap_encode__doc__}, + {"charmap_encode", (PyCFunction)_codecs_charmap_encode, METH_FASTCALL, _codecs_charmap_encode__doc__}, static PyObject * _codecs_charmap_encode_impl(PyObject *module, PyObject *str, const char *errors, PyObject *mapping); static PyObject * -_codecs_charmap_encode(PyObject *module, PyObject *args) +_codecs_charmap_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *str; const char *errors = NULL; PyObject *mapping = NULL; - if (!PyArg_ParseTuple(args, "U|zO:charmap_encode", + if (!_PyArg_ParseStack(args, nargs, "U|zO:charmap_encode", &str, &errors, &mapping)) { goto exit; } + + if (!_PyArg_NoStackKeywords("charmap_encode", kwnames)) { + goto exit; + } return_value = _codecs_charmap_encode_impl(module, str, errors, mapping); exit: @@ -1360,22 +1504,26 @@ PyDoc_STRVAR(_codecs_mbcs_encode__doc__, "\n"); #define _CODECS_MBCS_ENCODE_METHODDEF \ - {"mbcs_encode", (PyCFunction)_codecs_mbcs_encode, METH_VARARGS, _codecs_mbcs_encode__doc__}, + {"mbcs_encode", (PyCFunction)_codecs_mbcs_encode, METH_FASTCALL, _codecs_mbcs_encode__doc__}, static PyObject * _codecs_mbcs_encode_impl(PyObject *module, PyObject *str, const char *errors); static PyObject * -_codecs_mbcs_encode(PyObject *module, PyObject *args) +_codecs_mbcs_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *str; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "U|z:mbcs_encode", + if (!_PyArg_ParseStack(args, nargs, "U|z:mbcs_encode", &str, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("mbcs_encode", kwnames)) { + goto exit; + } return_value = _codecs_mbcs_encode_impl(module, str, errors); exit: @@ -1392,22 +1540,26 @@ PyDoc_STRVAR(_codecs_oem_encode__doc__, "\n"); #define _CODECS_OEM_ENCODE_METHODDEF \ - {"oem_encode", (PyCFunction)_codecs_oem_encode, METH_VARARGS, _codecs_oem_encode__doc__}, + {"oem_encode", (PyCFunction)_codecs_oem_encode, METH_FASTCALL, _codecs_oem_encode__doc__}, static PyObject * _codecs_oem_encode_impl(PyObject *module, PyObject *str, const char *errors); static PyObject * -_codecs_oem_encode(PyObject *module, PyObject *args) +_codecs_oem_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *str; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "U|z:oem_encode", + if (!_PyArg_ParseStack(args, nargs, "U|z:oem_encode", &str, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("oem_encode", kwnames)) { + goto exit; + } return_value = _codecs_oem_encode_impl(module, str, errors); exit: @@ -1424,24 +1576,28 @@ PyDoc_STRVAR(_codecs_code_page_encode__doc__, "\n"); #define _CODECS_CODE_PAGE_ENCODE_METHODDEF \ - {"code_page_encode", (PyCFunction)_codecs_code_page_encode, METH_VARARGS, _codecs_code_page_encode__doc__}, + {"code_page_encode", (PyCFunction)_codecs_code_page_encode, METH_FASTCALL, _codecs_code_page_encode__doc__}, static PyObject * _codecs_code_page_encode_impl(PyObject *module, int code_page, PyObject *str, const char *errors); static PyObject * -_codecs_code_page_encode(PyObject *module, PyObject *args) +_codecs_code_page_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int code_page; PyObject *str; const char *errors = NULL; - if (!PyArg_ParseTuple(args, "iU|z:code_page_encode", + if (!_PyArg_ParseStack(args, nargs, "iU|z:code_page_encode", &code_page, &str, &errors)) { goto exit; } + + if (!_PyArg_NoStackKeywords("code_page_encode", kwnames)) { + goto exit; + } return_value = _codecs_code_page_encode_impl(module, code_page, str, errors); exit: @@ -1461,23 +1617,27 @@ PyDoc_STRVAR(_codecs_register_error__doc__, "error and must return a (replacement, new position) tuple."); #define _CODECS_REGISTER_ERROR_METHODDEF \ - {"register_error", (PyCFunction)_codecs_register_error, METH_VARARGS, _codecs_register_error__doc__}, + {"register_error", (PyCFunction)_codecs_register_error, METH_FASTCALL, _codecs_register_error__doc__}, static PyObject * _codecs_register_error_impl(PyObject *module, const char *errors, PyObject *handler); static PyObject * -_codecs_register_error(PyObject *module, PyObject *args) +_codecs_register_error(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; const char *errors; PyObject *handler; - if (!PyArg_ParseTuple(args, "sO:register_error", + if (!_PyArg_ParseStack(args, nargs, "sO:register_error", &errors, &handler)) { goto exit; } + + if (!_PyArg_NoStackKeywords("register_error", kwnames)) { + goto exit; + } return_value = _codecs_register_error_impl(module, errors, handler); exit: @@ -1537,4 +1697,4 @@ exit: #ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF #define _CODECS_CODE_PAGE_ENCODE_METHODDEF #endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */ -/*[clinic end generated code: output=6d6afcabde10ed79 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=36fb42f450a3b4dc input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/_cryptmodule.inc b/third_party/python/Modules/clinic/_cryptmodule.inc index 0947a62ab..f78dfb46a 100644 --- a/third_party/python/Modules/clinic/_cryptmodule.inc +++ b/third_party/python/Modules/clinic/_cryptmodule.inc @@ -15,25 +15,29 @@ PyDoc_STRVAR(crypt_crypt__doc__, "results for a given *word*."); #define CRYPT_CRYPT_METHODDEF \ - {"crypt", (PyCFunction)crypt_crypt, METH_VARARGS, crypt_crypt__doc__}, + {"crypt", (PyCFunction)crypt_crypt, METH_FASTCALL, crypt_crypt__doc__}, static PyObject * crypt_crypt_impl(PyObject *module, const char *word, const char *salt); static PyObject * -crypt_crypt(PyObject *module, PyObject *args) +crypt_crypt(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; const char *word; const char *salt; - if (!PyArg_ParseTuple(args, "ss:crypt", + if (!_PyArg_ParseStack(args, nargs, "ss:crypt", &word, &salt)) { goto exit; } + + if (!_PyArg_NoStackKeywords("crypt", kwnames)) { + goto exit; + } return_value = crypt_crypt_impl(module, word, salt); exit: return return_value; } -/*[clinic end generated code: output=8dfc88264e662df4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3fd5d3625a6f32fe input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/_datetimemodule.inc b/third_party/python/Modules/clinic/_datetimemodule.inc index 9ecd9a7c0..bd77e1c76 100644 --- a/third_party/python/Modules/clinic/_datetimemodule.inc +++ b/third_party/python/Modules/clinic/_datetimemodule.inc @@ -37,4 +37,4 @@ datetime_datetime_now(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, PyO exit: return return_value; } -/*[clinic end generated code: output=8aaac0705add61ca input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ff78f2f51687e9a9 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/_dbmmodule.inc b/third_party/python/Modules/clinic/_dbmmodule.inc index e870110b4..6a0667de6 100644 --- a/third_party/python/Modules/clinic/_dbmmodule.inc +++ b/third_party/python/Modules/clinic/_dbmmodule.inc @@ -46,24 +46,28 @@ PyDoc_STRVAR(_dbm_dbm_get__doc__, "Return the value for key if present, otherwise default."); #define _DBM_DBM_GET_METHODDEF \ - {"get", (PyCFunction)_dbm_dbm_get, METH_VARARGS, _dbm_dbm_get__doc__}, + {"get", (PyCFunction)_dbm_dbm_get, METH_FASTCALL, _dbm_dbm_get__doc__}, static PyObject * _dbm_dbm_get_impl(dbmobject *self, const char *key, Py_ssize_clean_t key_length, PyObject *default_value); static PyObject * -_dbm_dbm_get(dbmobject *self, PyObject *args) +_dbm_dbm_get(dbmobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; const char *key; Py_ssize_clean_t key_length; PyObject *default_value = Py_None; - if (!PyArg_ParseTuple(args, "s#|O:get", + if (!_PyArg_ParseStack(args, nargs, "s#|O:get", &key, &key_length, &default_value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("get", kwnames)) { + goto exit; + } return_value = _dbm_dbm_get_impl(self, key, key_length, default_value); exit: @@ -79,7 +83,7 @@ PyDoc_STRVAR(_dbm_dbm_setdefault__doc__, "If key is not in the database, it is inserted with default as the value."); #define _DBM_DBM_SETDEFAULT_METHODDEF \ - {"setdefault", (PyCFunction)_dbm_dbm_setdefault, METH_VARARGS, _dbm_dbm_setdefault__doc__}, + {"setdefault", (PyCFunction)_dbm_dbm_setdefault, METH_FASTCALL, _dbm_dbm_setdefault__doc__}, static PyObject * _dbm_dbm_setdefault_impl(dbmobject *self, const char *key, @@ -87,17 +91,21 @@ _dbm_dbm_setdefault_impl(dbmobject *self, const char *key, PyObject *default_value); static PyObject * -_dbm_dbm_setdefault(dbmobject *self, PyObject *args) +_dbm_dbm_setdefault(dbmobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; const char *key; Py_ssize_clean_t key_length; PyObject *default_value = NULL; - if (!PyArg_ParseTuple(args, "s#|O:setdefault", + if (!_PyArg_ParseStack(args, nargs, "s#|O:setdefault", &key, &key_length, &default_value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("setdefault", kwnames)) { + goto exit; + } return_value = _dbm_dbm_setdefault_impl(self, key, key_length, default_value); exit: @@ -119,27 +127,31 @@ PyDoc_STRVAR(dbmopen__doc__, " (e.g. os.O_RDWR)."); #define DBMOPEN_METHODDEF \ - {"open", (PyCFunction)dbmopen, METH_VARARGS, dbmopen__doc__}, + {"open", (PyCFunction)dbmopen, METH_FASTCALL, dbmopen__doc__}, static PyObject * dbmopen_impl(PyObject *module, PyObject *filename, const char *flags, int mode); static PyObject * -dbmopen(PyObject *module, PyObject *args) +dbmopen(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *filename; const char *flags = "r"; int mode = 438; - if (!PyArg_ParseTuple(args, "U|si:open", + if (!_PyArg_ParseStack(args, nargs, "U|si:open", &filename, &flags, &mode)) { goto exit; } + + if (!_PyArg_NoStackKeywords("open", kwnames)) { + goto exit; + } return_value = dbmopen_impl(module, filename, flags, mode); exit: return return_value; } -/*[clinic end generated code: output=919cc4337be4a5d3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=60482e924110a70a input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/_elementtree.inc b/third_party/python/Modules/clinic/_elementtree.inc index 65456962d..cad86ef0c 100644 --- a/third_party/python/Modules/clinic/_elementtree.inc +++ b/third_party/python/Modules/clinic/_elementtree.inc @@ -357,23 +357,27 @@ PyDoc_STRVAR(_elementtree_Element_insert__doc__, "\n"); #define _ELEMENTTREE_ELEMENT_INSERT_METHODDEF \ - {"insert", (PyCFunction)_elementtree_Element_insert, METH_VARARGS, _elementtree_Element_insert__doc__}, + {"insert", (PyCFunction)_elementtree_Element_insert, METH_FASTCALL, _elementtree_Element_insert__doc__}, static PyObject * _elementtree_Element_insert_impl(ElementObject *self, Py_ssize_t index, PyObject *subelement); static PyObject * -_elementtree_Element_insert(ElementObject *self, PyObject *args) +_elementtree_Element_insert(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t index; PyObject *subelement; - if (!PyArg_ParseTuple(args, "nO!:insert", + if (!_PyArg_ParseStack(args, nargs, "nO!:insert", &index, &Element_Type, &subelement)) { goto exit; } + + if (!_PyArg_NoStackKeywords("insert", kwnames)) { + goto exit; + } return_value = _elementtree_Element_insert_impl(self, index, subelement); exit: @@ -703,4 +707,4 @@ _elementtree_XMLParser__setevents(XMLParserObject *self, PyObject *args) exit: return return_value; } -/*[clinic end generated code: output=b4a571a98ced3163 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4e3d22c6f6d832b2 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/_gdbmmodule.inc b/third_party/python/Modules/clinic/_gdbmmodule.inc index 639a4174e..0a24a5000 100644 --- a/third_party/python/Modules/clinic/_gdbmmodule.inc +++ b/third_party/python/Modules/clinic/_gdbmmodule.inc @@ -232,27 +232,31 @@ PyDoc_STRVAR(dbmopen__doc__, "when the database has to be created. It defaults to octal 0o666."); #define DBMOPEN_METHODDEF \ - {"open", (PyCFunction)dbmopen, METH_VARARGS, dbmopen__doc__}, + {"open", (PyCFunction)dbmopen, METH_FASTCALL, dbmopen__doc__}, static PyObject * dbmopen_impl(PyObject *module, PyObject *filename, const char *flags, int mode); static PyObject * -dbmopen(PyObject *module, PyObject *args) +dbmopen(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *filename; const char *flags = "r"; int mode = 438; - if (!PyArg_ParseTuple(args, "U|si:open", + if (!_PyArg_ParseStack(args, nargs, "U|si:open", &filename, &flags, &mode)) { goto exit; } + + if (!_PyArg_NoStackKeywords("open", kwnames)) { + goto exit; + } return_value = dbmopen_impl(module, filename, flags, mode); exit: return return_value; } -/*[clinic end generated code: output=afb99364ac420d10 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=16874d4acd7e7749 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/_lzmamodule.inc b/third_party/python/Modules/clinic/_lzmamodule.inc index 940305320..64d4ce133 100644 --- a/third_party/python/Modules/clinic/_lzmamodule.inc +++ b/third_party/python/Modules/clinic/_lzmamodule.inc @@ -230,23 +230,27 @@ PyDoc_STRVAR(_lzma__decode_filter_properties__doc__, "The result does not include the filter ID itself, only the options."); #define _LZMA__DECODE_FILTER_PROPERTIES_METHODDEF \ - {"_decode_filter_properties", (PyCFunction)_lzma__decode_filter_properties, METH_VARARGS, _lzma__decode_filter_properties__doc__}, + {"_decode_filter_properties", (PyCFunction)_lzma__decode_filter_properties, METH_FASTCALL, _lzma__decode_filter_properties__doc__}, static PyObject * _lzma__decode_filter_properties_impl(PyObject *module, lzma_vli filter_id, Py_buffer *encoded_props); static PyObject * -_lzma__decode_filter_properties(PyObject *module, PyObject *args) +_lzma__decode_filter_properties(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; lzma_vli filter_id; Py_buffer encoded_props = {NULL, NULL}; - if (!PyArg_ParseTuple(args, "O&y*:_decode_filter_properties", + if (!_PyArg_ParseStack(args, nargs, "O&y*:_decode_filter_properties", lzma_vli_converter, &filter_id, &encoded_props)) { goto exit; } + + if (!_PyArg_NoStackKeywords("_decode_filter_properties", kwnames)) { + goto exit; + } return_value = _lzma__decode_filter_properties_impl(module, filter_id, &encoded_props); exit: @@ -257,4 +261,4 @@ exit: return return_value; } -/*[clinic end generated code: output=f27abae460122706 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5f7a915fb7e41453 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/_opcode.inc b/third_party/python/Modules/clinic/_opcode.inc index 2646dfef0..e95a190fe 100644 --- a/third_party/python/Modules/clinic/_opcode.inc +++ b/third_party/python/Modules/clinic/_opcode.inc @@ -10,23 +10,27 @@ PyDoc_STRVAR(_opcode_stack_effect__doc__, "Compute the stack effect of the opcode."); #define _OPCODE_STACK_EFFECT_METHODDEF \ - {"stack_effect", (PyCFunction)_opcode_stack_effect, METH_VARARGS, _opcode_stack_effect__doc__}, + {"stack_effect", (PyCFunction)_opcode_stack_effect, METH_FASTCALL, _opcode_stack_effect__doc__}, static int _opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg); static PyObject * -_opcode_stack_effect(PyObject *module, PyObject *args) +_opcode_stack_effect(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int opcode; PyObject *oparg = Py_None; int _return_value; - if (!PyArg_ParseTuple(args, "i|O:stack_effect", + if (!_PyArg_ParseStack(args, nargs, "i|O:stack_effect", &opcode, &oparg)) { goto exit; } + + if (!_PyArg_NoStackKeywords("stack_effect", kwnames)) { + goto exit; + } _return_value = _opcode_stack_effect_impl(module, opcode, oparg); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; @@ -36,4 +40,4 @@ _opcode_stack_effect(PyObject *module, PyObject *args) exit: return return_value; } -/*[clinic end generated code: output=4d91c6a765097853 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=62858005ac85baa9 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/_pickle.inc b/third_party/python/Modules/clinic/_pickle.inc index 588812124..4f16a3c1a 100644 --- a/third_party/python/Modules/clinic/_pickle.inc +++ b/third_party/python/Modules/clinic/_pickle.inc @@ -561,4 +561,4 @@ _pickle_loads(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn exit: return return_value; } -/*[clinic end generated code: output=82be137b3c09cb9f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d7222d1219039fbd input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/_sre.inc b/third_party/python/Modules/clinic/_sre.inc index 9b2ed6926..23d99befe 100644 --- a/third_party/python/Modules/clinic/_sre.inc +++ b/third_party/python/Modules/clinic/_sre.inc @@ -36,23 +36,27 @@ PyDoc_STRVAR(_sre_getlower__doc__, "\n"); #define _SRE_GETLOWER_METHODDEF \ - {"getlower", (PyCFunction)_sre_getlower, METH_VARARGS, _sre_getlower__doc__}, + {"getlower", (PyCFunction)_sre_getlower, METH_FASTCALL, _sre_getlower__doc__}, static int _sre_getlower_impl(PyObject *module, int character, int flags); static PyObject * -_sre_getlower(PyObject *module, PyObject *args) +_sre_getlower(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int character; int flags; int _return_value; - if (!PyArg_ParseTuple(args, "ii:getlower", + if (!_PyArg_ParseStack(args, nargs, "ii:getlower", &character, &flags)) { goto exit; } + + if (!_PyArg_NoStackKeywords("getlower", kwnames)) { + goto exit; + } _return_value = _sre_getlower_impl(module, character, flags); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; @@ -729,4 +733,4 @@ _sre_SRE_Scanner_search(ScannerObject *self, PyObject *Py_UNUSED(ignored)) { return _sre_SRE_Scanner_search_impl(self); } -/*[clinic end generated code: output=a4a246bca1963bc9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b347a5bd7e21cfd4 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/_weakref.inc b/third_party/python/Modules/clinic/_weakref.inc index bad7e1033..01d55fc2b 100644 --- a/third_party/python/Modules/clinic/_weakref.inc +++ b/third_party/python/Modules/clinic/_weakref.inc @@ -38,26 +38,30 @@ PyDoc_STRVAR(_weakref__remove_dead_weakref__doc__, "Atomically remove key from dict if it points to a dead weakref."); #define _WEAKREF__REMOVE_DEAD_WEAKREF_METHODDEF \ - {"_remove_dead_weakref", (PyCFunction)_weakref__remove_dead_weakref, METH_VARARGS, _weakref__remove_dead_weakref__doc__}, + {"_remove_dead_weakref", (PyCFunction)_weakref__remove_dead_weakref, METH_FASTCALL, _weakref__remove_dead_weakref__doc__}, static PyObject * _weakref__remove_dead_weakref_impl(PyObject *module, PyObject *dct, PyObject *key); static PyObject * -_weakref__remove_dead_weakref(PyObject *module, PyObject *args) +_weakref__remove_dead_weakref(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *dct; PyObject *key; - if (!PyArg_ParseTuple(args, "O!O:_remove_dead_weakref", + if (!_PyArg_ParseStack(args, nargs, "O!O:_remove_dead_weakref", &PyDict_Type, &dct, &key)) { goto exit; } + + if (!_PyArg_NoStackKeywords("_remove_dead_weakref", kwnames)) { + goto exit; + } return_value = _weakref__remove_dead_weakref_impl(module, dct, key); exit: return return_value; } -/*[clinic end generated code: output=e860dd818a44bc9b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b686303486bdfefd input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/arraymodule.inc b/third_party/python/Modules/clinic/arraymodule.inc index 9df40c526..c09471eaf 100644 --- a/third_party/python/Modules/clinic/arraymodule.inc +++ b/third_party/python/Modules/clinic/arraymodule.inc @@ -66,21 +66,25 @@ PyDoc_STRVAR(array_array_pop__doc__, "i defaults to -1."); #define ARRAY_ARRAY_POP_METHODDEF \ - {"pop", (PyCFunction)array_array_pop, METH_VARARGS, array_array_pop__doc__}, + {"pop", (PyCFunction)array_array_pop, METH_FASTCALL, array_array_pop__doc__}, static PyObject * array_array_pop_impl(arrayobject *self, Py_ssize_t i); static PyObject * -array_array_pop(arrayobject *self, PyObject *args) +array_array_pop(arrayobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t i = -1; - if (!PyArg_ParseTuple(args, "|n:pop", + if (!_PyArg_ParseStack(args, nargs, "|n:pop", &i)) { goto exit; } + + if (!_PyArg_NoStackKeywords("pop", kwnames)) { + goto exit; + } return_value = array_array_pop_impl(self, i); exit: @@ -103,22 +107,26 @@ PyDoc_STRVAR(array_array_insert__doc__, "Insert a new item v into the array before position i."); #define ARRAY_ARRAY_INSERT_METHODDEF \ - {"insert", (PyCFunction)array_array_insert, METH_VARARGS, array_array_insert__doc__}, + {"insert", (PyCFunction)array_array_insert, METH_FASTCALL, array_array_insert__doc__}, static PyObject * array_array_insert_impl(arrayobject *self, Py_ssize_t i, PyObject *v); static PyObject * -array_array_insert(arrayobject *self, PyObject *args) +array_array_insert(arrayobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t i; PyObject *v; - if (!PyArg_ParseTuple(args, "nO:insert", + if (!_PyArg_ParseStack(args, nargs, "nO:insert", &i, &v)) { goto exit; } + + if (!_PyArg_NoStackKeywords("insert", kwnames)) { + goto exit; + } return_value = array_array_insert_impl(self, i, v); exit: @@ -201,22 +209,26 @@ PyDoc_STRVAR(array_array_fromfile__doc__, "Read n objects from the file object f and append them to the end of the array."); #define ARRAY_ARRAY_FROMFILE_METHODDEF \ - {"fromfile", (PyCFunction)array_array_fromfile, METH_VARARGS, array_array_fromfile__doc__}, + {"fromfile", (PyCFunction)array_array_fromfile, METH_FASTCALL, array_array_fromfile__doc__}, static PyObject * array_array_fromfile_impl(arrayobject *self, PyObject *f, Py_ssize_t n); static PyObject * -array_array_fromfile(arrayobject *self, PyObject *args) +array_array_fromfile(arrayobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *f; Py_ssize_t n; - if (!PyArg_ParseTuple(args, "On:fromfile", + if (!_PyArg_ParseStack(args, nargs, "On:fromfile", &f, &n)) { goto exit; } + + if (!_PyArg_NoStackKeywords("fromfile", kwnames)) { + goto exit; + } return_value = array_array_fromfile_impl(self, f, n); exit: @@ -444,7 +456,7 @@ PyDoc_STRVAR(array__array_reconstructor__doc__, "Internal. Used for pickling support."); #define ARRAY__ARRAY_RECONSTRUCTOR_METHODDEF \ - {"_array_reconstructor", (PyCFunction)array__array_reconstructor, METH_VARARGS, array__array_reconstructor__doc__}, + {"_array_reconstructor", (PyCFunction)array__array_reconstructor, METH_FASTCALL, array__array_reconstructor__doc__}, static PyObject * array__array_reconstructor_impl(PyObject *module, PyTypeObject *arraytype, @@ -453,7 +465,7 @@ array__array_reconstructor_impl(PyObject *module, PyTypeObject *arraytype, PyObject *items); static PyObject * -array__array_reconstructor(PyObject *module, PyObject *args) +array__array_reconstructor(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyTypeObject *arraytype; @@ -461,10 +473,14 @@ array__array_reconstructor(PyObject *module, PyObject *args) enum machine_format_code mformat_code; PyObject *items; - if (!PyArg_ParseTuple(args, "OCiO:_array_reconstructor", + if (!_PyArg_ParseStack(args, nargs, "OCiO:_array_reconstructor", &arraytype, &typecode, &mformat_code, &items)) { goto exit; } + + if (!_PyArg_NoStackKeywords("_array_reconstructor", kwnames)) { + goto exit; + } return_value = array__array_reconstructor_impl(module, arraytype, typecode, mformat_code, items); exit: @@ -506,4 +522,4 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__, #define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \ {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, -/*[clinic end generated code: output=b2054fb764c8cc64 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d186a7553c1f1a41 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/audioop.inc b/third_party/python/Modules/clinic/audioop.inc index 1fb13fddb..6ba1172e9 100644 --- a/third_party/python/Modules/clinic/audioop.inc +++ b/third_party/python/Modules/clinic/audioop.inc @@ -1,8 +1,6 @@ -/* clang-format off */ /*[clinic input] preserve [clinic start generated code]*/ -#include "third_party/python/Include/abstract.h" PyDoc_STRVAR(audioop_getsample__doc__, "getsample($module, fragment, width, index, /)\n" @@ -11,24 +9,28 @@ PyDoc_STRVAR(audioop_getsample__doc__, "Return the value of sample index from the fragment."); #define AUDIOOP_GETSAMPLE_METHODDEF \ - {"getsample", (PyCFunction)audioop_getsample, METH_VARARGS, audioop_getsample__doc__}, + {"getsample", (PyCFunction)audioop_getsample, METH_FASTCALL, audioop_getsample__doc__}, static PyObject * audioop_getsample_impl(PyObject *module, Py_buffer *fragment, int width, Py_ssize_t index); static PyObject * -audioop_getsample(PyObject *module, PyObject *args) +audioop_getsample(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; Py_ssize_t index; - if (!PyArg_ParseTuple(args, "y*in:getsample", + if (!_PyArg_ParseStack(args, nargs, "y*in:getsample", &fragment, &width, &index)) { goto exit; } + + if (!_PyArg_NoStackKeywords("getsample", kwnames)) { + goto exit; + } return_value = audioop_getsample_impl(module, &fragment, width, index); exit: @@ -47,22 +49,26 @@ PyDoc_STRVAR(audioop_max__doc__, "Return the maximum of the absolute value of all samples in a fragment."); #define AUDIOOP_MAX_METHODDEF \ - {"max", (PyCFunction)audioop_max, METH_VARARGS, audioop_max__doc__}, + {"max", (PyCFunction)audioop_max, METH_FASTCALL, audioop_max__doc__}, static PyObject * audioop_max_impl(PyObject *module, Py_buffer *fragment, int width); static PyObject * -audioop_max(PyObject *module, PyObject *args) +audioop_max(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; - if (!PyArg_ParseTuple(args, "y*i:max", + if (!_PyArg_ParseStack(args, nargs, "y*i:max", &fragment, &width)) { goto exit; } + + if (!_PyArg_NoStackKeywords("max", kwnames)) { + goto exit; + } return_value = audioop_max_impl(module, &fragment, width); exit: @@ -81,22 +87,26 @@ PyDoc_STRVAR(audioop_minmax__doc__, "Return the minimum and maximum values of all samples in the sound fragment."); #define AUDIOOP_MINMAX_METHODDEF \ - {"minmax", (PyCFunction)audioop_minmax, METH_VARARGS, audioop_minmax__doc__}, + {"minmax", (PyCFunction)audioop_minmax, METH_FASTCALL, audioop_minmax__doc__}, static PyObject * audioop_minmax_impl(PyObject *module, Py_buffer *fragment, int width); static PyObject * -audioop_minmax(PyObject *module, PyObject *args) +audioop_minmax(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; - if (!PyArg_ParseTuple(args, "y*i:minmax", + if (!_PyArg_ParseStack(args, nargs, "y*i:minmax", &fragment, &width)) { goto exit; } + + if (!_PyArg_NoStackKeywords("minmax", kwnames)) { + goto exit; + } return_value = audioop_minmax_impl(module, &fragment, width); exit: @@ -115,22 +125,26 @@ PyDoc_STRVAR(audioop_avg__doc__, "Return the average over all samples in the fragment."); #define AUDIOOP_AVG_METHODDEF \ - {"avg", (PyCFunction)audioop_avg, METH_VARARGS, audioop_avg__doc__}, + {"avg", (PyCFunction)audioop_avg, METH_FASTCALL, audioop_avg__doc__}, static PyObject * audioop_avg_impl(PyObject *module, Py_buffer *fragment, int width); static PyObject * -audioop_avg(PyObject *module, PyObject *args) +audioop_avg(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; - if (!PyArg_ParseTuple(args, "y*i:avg", + if (!_PyArg_ParseStack(args, nargs, "y*i:avg", &fragment, &width)) { goto exit; } + + if (!_PyArg_NoStackKeywords("avg", kwnames)) { + goto exit; + } return_value = audioop_avg_impl(module, &fragment, width); exit: @@ -149,22 +163,26 @@ PyDoc_STRVAR(audioop_rms__doc__, "Return the root-mean-square of the fragment, i.e. sqrt(sum(S_i^2)/n)."); #define AUDIOOP_RMS_METHODDEF \ - {"rms", (PyCFunction)audioop_rms, METH_VARARGS, audioop_rms__doc__}, + {"rms", (PyCFunction)audioop_rms, METH_FASTCALL, audioop_rms__doc__}, static PyObject * audioop_rms_impl(PyObject *module, Py_buffer *fragment, int width); static PyObject * -audioop_rms(PyObject *module, PyObject *args) +audioop_rms(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; - if (!PyArg_ParseTuple(args, "y*i:rms", + if (!_PyArg_ParseStack(args, nargs, "y*i:rms", &fragment, &width)) { goto exit; } + + if (!_PyArg_NoStackKeywords("rms", kwnames)) { + goto exit; + } return_value = audioop_rms_impl(module, &fragment, width); exit: @@ -183,23 +201,27 @@ PyDoc_STRVAR(audioop_findfit__doc__, "Try to match reference as well as possible to a portion of fragment."); #define AUDIOOP_FINDFIT_METHODDEF \ - {"findfit", (PyCFunction)audioop_findfit, METH_VARARGS, audioop_findfit__doc__}, + {"findfit", (PyCFunction)audioop_findfit, METH_FASTCALL, audioop_findfit__doc__}, static PyObject * audioop_findfit_impl(PyObject *module, Py_buffer *fragment, Py_buffer *reference); static PyObject * -audioop_findfit(PyObject *module, PyObject *args) +audioop_findfit(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; Py_buffer reference = {NULL, NULL}; - if (!PyArg_ParseTuple(args, "y*y*:findfit", + if (!_PyArg_ParseStack(args, nargs, "y*y*:findfit", &fragment, &reference)) { goto exit; } + + if (!_PyArg_NoStackKeywords("findfit", kwnames)) { + goto exit; + } return_value = audioop_findfit_impl(module, &fragment, &reference); exit: @@ -222,23 +244,27 @@ PyDoc_STRVAR(audioop_findfactor__doc__, "Return a factor F such that rms(add(fragment, mul(reference, -F))) is minimal."); #define AUDIOOP_FINDFACTOR_METHODDEF \ - {"findfactor", (PyCFunction)audioop_findfactor, METH_VARARGS, audioop_findfactor__doc__}, + {"findfactor", (PyCFunction)audioop_findfactor, METH_FASTCALL, audioop_findfactor__doc__}, static PyObject * audioop_findfactor_impl(PyObject *module, Py_buffer *fragment, Py_buffer *reference); static PyObject * -audioop_findfactor(PyObject *module, PyObject *args) +audioop_findfactor(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; Py_buffer reference = {NULL, NULL}; - if (!PyArg_ParseTuple(args, "y*y*:findfactor", + if (!_PyArg_ParseStack(args, nargs, "y*y*:findfactor", &fragment, &reference)) { goto exit; } + + if (!_PyArg_NoStackKeywords("findfactor", kwnames)) { + goto exit; + } return_value = audioop_findfactor_impl(module, &fragment, &reference); exit: @@ -261,23 +287,27 @@ PyDoc_STRVAR(audioop_findmax__doc__, "Search fragment for a slice of specified number of samples with maximum energy."); #define AUDIOOP_FINDMAX_METHODDEF \ - {"findmax", (PyCFunction)audioop_findmax, METH_VARARGS, audioop_findmax__doc__}, + {"findmax", (PyCFunction)audioop_findmax, METH_FASTCALL, audioop_findmax__doc__}, static PyObject * audioop_findmax_impl(PyObject *module, Py_buffer *fragment, Py_ssize_t length); static PyObject * -audioop_findmax(PyObject *module, PyObject *args) +audioop_findmax(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; Py_ssize_t length; - if (!PyArg_ParseTuple(args, "y*n:findmax", + if (!_PyArg_ParseStack(args, nargs, "y*n:findmax", &fragment, &length)) { goto exit; } + + if (!_PyArg_NoStackKeywords("findmax", kwnames)) { + goto exit; + } return_value = audioop_findmax_impl(module, &fragment, length); exit: @@ -296,22 +326,26 @@ PyDoc_STRVAR(audioop_avgpp__doc__, "Return the average peak-peak value over all samples in the fragment."); #define AUDIOOP_AVGPP_METHODDEF \ - {"avgpp", (PyCFunction)audioop_avgpp, METH_VARARGS, audioop_avgpp__doc__}, + {"avgpp", (PyCFunction)audioop_avgpp, METH_FASTCALL, audioop_avgpp__doc__}, static PyObject * audioop_avgpp_impl(PyObject *module, Py_buffer *fragment, int width); static PyObject * -audioop_avgpp(PyObject *module, PyObject *args) +audioop_avgpp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; - if (!PyArg_ParseTuple(args, "y*i:avgpp", + if (!_PyArg_ParseStack(args, nargs, "y*i:avgpp", &fragment, &width)) { goto exit; } + + if (!_PyArg_NoStackKeywords("avgpp", kwnames)) { + goto exit; + } return_value = audioop_avgpp_impl(module, &fragment, width); exit: @@ -330,22 +364,26 @@ PyDoc_STRVAR(audioop_maxpp__doc__, "Return the maximum peak-peak value in the sound fragment."); #define AUDIOOP_MAXPP_METHODDEF \ - {"maxpp", (PyCFunction)audioop_maxpp, METH_VARARGS, audioop_maxpp__doc__}, + {"maxpp", (PyCFunction)audioop_maxpp, METH_FASTCALL, audioop_maxpp__doc__}, static PyObject * audioop_maxpp_impl(PyObject *module, Py_buffer *fragment, int width); static PyObject * -audioop_maxpp(PyObject *module, PyObject *args) +audioop_maxpp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; - if (!PyArg_ParseTuple(args, "y*i:maxpp", + if (!_PyArg_ParseStack(args, nargs, "y*i:maxpp", &fragment, &width)) { goto exit; } + + if (!_PyArg_NoStackKeywords("maxpp", kwnames)) { + goto exit; + } return_value = audioop_maxpp_impl(module, &fragment, width); exit: @@ -364,22 +402,26 @@ PyDoc_STRVAR(audioop_cross__doc__, "Return the number of zero crossings in the fragment passed as an argument."); #define AUDIOOP_CROSS_METHODDEF \ - {"cross", (PyCFunction)audioop_cross, METH_VARARGS, audioop_cross__doc__}, + {"cross", (PyCFunction)audioop_cross, METH_FASTCALL, audioop_cross__doc__}, static PyObject * audioop_cross_impl(PyObject *module, Py_buffer *fragment, int width); static PyObject * -audioop_cross(PyObject *module, PyObject *args) +audioop_cross(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; - if (!PyArg_ParseTuple(args, "y*i:cross", + if (!_PyArg_ParseStack(args, nargs, "y*i:cross", &fragment, &width)) { goto exit; } + + if (!_PyArg_NoStackKeywords("cross", kwnames)) { + goto exit; + } return_value = audioop_cross_impl(module, &fragment, width); exit: @@ -398,24 +440,28 @@ PyDoc_STRVAR(audioop_mul__doc__, "Return a fragment that has all samples in the original fragment multiplied by the floating-point value factor."); #define AUDIOOP_MUL_METHODDEF \ - {"mul", (PyCFunction)audioop_mul, METH_VARARGS, audioop_mul__doc__}, + {"mul", (PyCFunction)audioop_mul, METH_FASTCALL, audioop_mul__doc__}, static PyObject * audioop_mul_impl(PyObject *module, Py_buffer *fragment, int width, double factor); static PyObject * -audioop_mul(PyObject *module, PyObject *args) +audioop_mul(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; double factor; - if (!PyArg_ParseTuple(args, "y*id:mul", + if (!_PyArg_ParseStack(args, nargs, "y*id:mul", &fragment, &width, &factor)) { goto exit; } + + if (!_PyArg_NoStackKeywords("mul", kwnames)) { + goto exit; + } return_value = audioop_mul_impl(module, &fragment, width, factor); exit: @@ -434,14 +480,14 @@ PyDoc_STRVAR(audioop_tomono__doc__, "Convert a stereo fragment to a mono fragment."); #define AUDIOOP_TOMONO_METHODDEF \ - {"tomono", (PyCFunction)audioop_tomono, METH_VARARGS, audioop_tomono__doc__}, + {"tomono", (PyCFunction)audioop_tomono, METH_FASTCALL, audioop_tomono__doc__}, static PyObject * audioop_tomono_impl(PyObject *module, Py_buffer *fragment, int width, double lfactor, double rfactor); static PyObject * -audioop_tomono(PyObject *module, PyObject *args) +audioop_tomono(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; @@ -449,10 +495,14 @@ audioop_tomono(PyObject *module, PyObject *args) double lfactor; double rfactor; - if (!PyArg_ParseTuple(args, "y*idd:tomono", + if (!_PyArg_ParseStack(args, nargs, "y*idd:tomono", &fragment, &width, &lfactor, &rfactor)) { goto exit; } + + if (!_PyArg_NoStackKeywords("tomono", kwnames)) { + goto exit; + } return_value = audioop_tomono_impl(module, &fragment, width, lfactor, rfactor); exit: @@ -471,14 +521,14 @@ PyDoc_STRVAR(audioop_tostereo__doc__, "Generate a stereo fragment from a mono fragment."); #define AUDIOOP_TOSTEREO_METHODDEF \ - {"tostereo", (PyCFunction)audioop_tostereo, METH_VARARGS, audioop_tostereo__doc__}, + {"tostereo", (PyCFunction)audioop_tostereo, METH_FASTCALL, audioop_tostereo__doc__}, static PyObject * audioop_tostereo_impl(PyObject *module, Py_buffer *fragment, int width, double lfactor, double rfactor); static PyObject * -audioop_tostereo(PyObject *module, PyObject *args) +audioop_tostereo(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; @@ -486,10 +536,14 @@ audioop_tostereo(PyObject *module, PyObject *args) double lfactor; double rfactor; - if (!PyArg_ParseTuple(args, "y*idd:tostereo", + if (!_PyArg_ParseStack(args, nargs, "y*idd:tostereo", &fragment, &width, &lfactor, &rfactor)) { goto exit; } + + if (!_PyArg_NoStackKeywords("tostereo", kwnames)) { + goto exit; + } return_value = audioop_tostereo_impl(module, &fragment, width, lfactor, rfactor); exit: @@ -508,24 +562,28 @@ PyDoc_STRVAR(audioop_add__doc__, "Return a fragment which is the addition of the two samples passed as parameters."); #define AUDIOOP_ADD_METHODDEF \ - {"add", (PyCFunction)audioop_add, METH_VARARGS, audioop_add__doc__}, + {"add", (PyCFunction)audioop_add, METH_FASTCALL, audioop_add__doc__}, static PyObject * audioop_add_impl(PyObject *module, Py_buffer *fragment1, Py_buffer *fragment2, int width); static PyObject * -audioop_add(PyObject *module, PyObject *args) +audioop_add(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment1 = {NULL, NULL}; Py_buffer fragment2 = {NULL, NULL}; int width; - if (!PyArg_ParseTuple(args, "y*y*i:add", + if (!_PyArg_ParseStack(args, nargs, "y*y*i:add", &fragment1, &fragment2, &width)) { goto exit; } + + if (!_PyArg_NoStackKeywords("add", kwnames)) { + goto exit; + } return_value = audioop_add_impl(module, &fragment1, &fragment2, width); exit: @@ -548,23 +606,27 @@ PyDoc_STRVAR(audioop_bias__doc__, "Return a fragment that is the original fragment with a bias added to each sample."); #define AUDIOOP_BIAS_METHODDEF \ - {"bias", (PyCFunction)audioop_bias, METH_VARARGS, audioop_bias__doc__}, + {"bias", (PyCFunction)audioop_bias, METH_FASTCALL, audioop_bias__doc__}, static PyObject * audioop_bias_impl(PyObject *module, Py_buffer *fragment, int width, int bias); static PyObject * -audioop_bias(PyObject *module, PyObject *args) +audioop_bias(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; int bias; - if (!PyArg_ParseTuple(args, "y*ii:bias", + if (!_PyArg_ParseStack(args, nargs, "y*ii:bias", &fragment, &width, &bias)) { goto exit; } + + if (!_PyArg_NoStackKeywords("bias", kwnames)) { + goto exit; + } return_value = audioop_bias_impl(module, &fragment, width, bias); exit: @@ -583,22 +645,26 @@ PyDoc_STRVAR(audioop_reverse__doc__, "Reverse the samples in a fragment and returns the modified fragment."); #define AUDIOOP_REVERSE_METHODDEF \ - {"reverse", (PyCFunction)audioop_reverse, METH_VARARGS, audioop_reverse__doc__}, + {"reverse", (PyCFunction)audioop_reverse, METH_FASTCALL, audioop_reverse__doc__}, static PyObject * audioop_reverse_impl(PyObject *module, Py_buffer *fragment, int width); static PyObject * -audioop_reverse(PyObject *module, PyObject *args) +audioop_reverse(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; - if (!PyArg_ParseTuple(args, "y*i:reverse", + if (!_PyArg_ParseStack(args, nargs, "y*i:reverse", &fragment, &width)) { goto exit; } + + if (!_PyArg_NoStackKeywords("reverse", kwnames)) { + goto exit; + } return_value = audioop_reverse_impl(module, &fragment, width); exit: @@ -617,22 +683,26 @@ PyDoc_STRVAR(audioop_byteswap__doc__, "Convert big-endian samples to little-endian and vice versa."); #define AUDIOOP_BYTESWAP_METHODDEF \ - {"byteswap", (PyCFunction)audioop_byteswap, METH_VARARGS, audioop_byteswap__doc__}, + {"byteswap", (PyCFunction)audioop_byteswap, METH_FASTCALL, audioop_byteswap__doc__}, static PyObject * audioop_byteswap_impl(PyObject *module, Py_buffer *fragment, int width); static PyObject * -audioop_byteswap(PyObject *module, PyObject *args) +audioop_byteswap(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; - if (!PyArg_ParseTuple(args, "y*i:byteswap", + if (!_PyArg_ParseStack(args, nargs, "y*i:byteswap", &fragment, &width)) { goto exit; } + + if (!_PyArg_NoStackKeywords("byteswap", kwnames)) { + goto exit; + } return_value = audioop_byteswap_impl(module, &fragment, width); exit: @@ -651,24 +721,28 @@ PyDoc_STRVAR(audioop_lin2lin__doc__, "Convert samples between 1-, 2-, 3- and 4-byte formats."); #define AUDIOOP_LIN2LIN_METHODDEF \ - {"lin2lin", (PyCFunction)audioop_lin2lin, METH_VARARGS, audioop_lin2lin__doc__}, + {"lin2lin", (PyCFunction)audioop_lin2lin, METH_FASTCALL, audioop_lin2lin__doc__}, static PyObject * audioop_lin2lin_impl(PyObject *module, Py_buffer *fragment, int width, int newwidth); static PyObject * -audioop_lin2lin(PyObject *module, PyObject *args) +audioop_lin2lin(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; int newwidth; - if (!PyArg_ParseTuple(args, "y*ii:lin2lin", + if (!_PyArg_ParseStack(args, nargs, "y*ii:lin2lin", &fragment, &width, &newwidth)) { goto exit; } + + if (!_PyArg_NoStackKeywords("lin2lin", kwnames)) { + goto exit; + } return_value = audioop_lin2lin_impl(module, &fragment, width, newwidth); exit: @@ -688,7 +762,7 @@ PyDoc_STRVAR(audioop_ratecv__doc__, "Convert the frame rate of the input fragment."); #define AUDIOOP_RATECV_METHODDEF \ - {"ratecv", (PyCFunction)audioop_ratecv, METH_VARARGS, audioop_ratecv__doc__}, + {"ratecv", (PyCFunction)audioop_ratecv, METH_FASTCALL, audioop_ratecv__doc__}, static PyObject * audioop_ratecv_impl(PyObject *module, Py_buffer *fragment, int width, @@ -696,7 +770,7 @@ audioop_ratecv_impl(PyObject *module, Py_buffer *fragment, int width, int weightA, int weightB); static PyObject * -audioop_ratecv(PyObject *module, PyObject *args) +audioop_ratecv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; @@ -708,10 +782,14 @@ audioop_ratecv(PyObject *module, PyObject *args) int weightA = 1; int weightB = 0; - if (!PyArg_ParseTuple(args, "y*iiiiO|ii:ratecv", + if (!_PyArg_ParseStack(args, nargs, "y*iiiiO|ii:ratecv", &fragment, &width, &nchannels, &inrate, &outrate, &state, &weightA, &weightB)) { goto exit; } + + if (!_PyArg_NoStackKeywords("ratecv", kwnames)) { + goto exit; + } return_value = audioop_ratecv_impl(module, &fragment, width, nchannels, inrate, outrate, state, weightA, weightB); exit: @@ -730,22 +808,26 @@ PyDoc_STRVAR(audioop_lin2ulaw__doc__, "Convert samples in the audio fragment to u-LAW encoding."); #define AUDIOOP_LIN2ULAW_METHODDEF \ - {"lin2ulaw", (PyCFunction)audioop_lin2ulaw, METH_VARARGS, audioop_lin2ulaw__doc__}, + {"lin2ulaw", (PyCFunction)audioop_lin2ulaw, METH_FASTCALL, audioop_lin2ulaw__doc__}, static PyObject * audioop_lin2ulaw_impl(PyObject *module, Py_buffer *fragment, int width); static PyObject * -audioop_lin2ulaw(PyObject *module, PyObject *args) +audioop_lin2ulaw(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; - if (!PyArg_ParseTuple(args, "y*i:lin2ulaw", + if (!_PyArg_ParseStack(args, nargs, "y*i:lin2ulaw", &fragment, &width)) { goto exit; } + + if (!_PyArg_NoStackKeywords("lin2ulaw", kwnames)) { + goto exit; + } return_value = audioop_lin2ulaw_impl(module, &fragment, width); exit: @@ -764,22 +846,26 @@ PyDoc_STRVAR(audioop_ulaw2lin__doc__, "Convert sound fragments in u-LAW encoding to linearly encoded sound fragments."); #define AUDIOOP_ULAW2LIN_METHODDEF \ - {"ulaw2lin", (PyCFunction)audioop_ulaw2lin, METH_VARARGS, audioop_ulaw2lin__doc__}, + {"ulaw2lin", (PyCFunction)audioop_ulaw2lin, METH_FASTCALL, audioop_ulaw2lin__doc__}, static PyObject * audioop_ulaw2lin_impl(PyObject *module, Py_buffer *fragment, int width); static PyObject * -audioop_ulaw2lin(PyObject *module, PyObject *args) +audioop_ulaw2lin(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; - if (!PyArg_ParseTuple(args, "y*i:ulaw2lin", + if (!_PyArg_ParseStack(args, nargs, "y*i:ulaw2lin", &fragment, &width)) { goto exit; } + + if (!_PyArg_NoStackKeywords("ulaw2lin", kwnames)) { + goto exit; + } return_value = audioop_ulaw2lin_impl(module, &fragment, width); exit: @@ -798,22 +884,26 @@ PyDoc_STRVAR(audioop_lin2alaw__doc__, "Convert samples in the audio fragment to a-LAW encoding."); #define AUDIOOP_LIN2ALAW_METHODDEF \ - {"lin2alaw", (PyCFunction)audioop_lin2alaw, METH_VARARGS, audioop_lin2alaw__doc__}, + {"lin2alaw", (PyCFunction)audioop_lin2alaw, METH_FASTCALL, audioop_lin2alaw__doc__}, static PyObject * audioop_lin2alaw_impl(PyObject *module, Py_buffer *fragment, int width); static PyObject * -audioop_lin2alaw(PyObject *module, PyObject *args) +audioop_lin2alaw(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; - if (!PyArg_ParseTuple(args, "y*i:lin2alaw", + if (!_PyArg_ParseStack(args, nargs, "y*i:lin2alaw", &fragment, &width)) { goto exit; } + + if (!_PyArg_NoStackKeywords("lin2alaw", kwnames)) { + goto exit; + } return_value = audioop_lin2alaw_impl(module, &fragment, width); exit: @@ -832,26 +922,34 @@ PyDoc_STRVAR(audioop_alaw2lin__doc__, "Convert sound fragments in a-LAW encoding to linearly encoded sound fragments."); #define AUDIOOP_ALAW2LIN_METHODDEF \ - {"alaw2lin", (PyCFunction)audioop_alaw2lin, METH_VARARGS, audioop_alaw2lin__doc__}, + {"alaw2lin", (PyCFunction)audioop_alaw2lin, METH_FASTCALL, audioop_alaw2lin__doc__}, static PyObject * audioop_alaw2lin_impl(PyObject *module, Py_buffer *fragment, int width); static PyObject * -audioop_alaw2lin(PyObject *module, PyObject *args) +audioop_alaw2lin(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; - if (!PyArg_ParseTuple(args, "y*i:alaw2lin", &fragment, &width)) { + + if (!_PyArg_ParseStack(args, nargs, "y*i:alaw2lin", + &fragment, &width)) { + goto exit; + } + + if (!_PyArg_NoStackKeywords("alaw2lin", kwnames)) { goto exit; } return_value = audioop_alaw2lin_impl(module, &fragment, width); + exit: /* Cleanup for fragment */ if (fragment.obj) { PyBuffer_Release(&fragment); } + return return_value; } @@ -862,24 +960,28 @@ PyDoc_STRVAR(audioop_lin2adpcm__doc__, "Convert samples to 4 bit Intel/DVI ADPCM encoding."); #define AUDIOOP_LIN2ADPCM_METHODDEF \ - {"lin2adpcm", (PyCFunction)audioop_lin2adpcm, METH_VARARGS, audioop_lin2adpcm__doc__}, + {"lin2adpcm", (PyCFunction)audioop_lin2adpcm, METH_FASTCALL, audioop_lin2adpcm__doc__}, static PyObject * audioop_lin2adpcm_impl(PyObject *module, Py_buffer *fragment, int width, PyObject *state); static PyObject * -audioop_lin2adpcm(PyObject *module, PyObject *args) +audioop_lin2adpcm(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; PyObject *state; - if (!PyArg_ParseTuple(args, "y*iO:lin2adpcm", + if (!_PyArg_ParseStack(args, nargs, "y*iO:lin2adpcm", &fragment, &width, &state)) { goto exit; } + + if (!_PyArg_NoStackKeywords("lin2adpcm", kwnames)) { + goto exit; + } return_value = audioop_lin2adpcm_impl(module, &fragment, width, state); exit: @@ -898,24 +1000,28 @@ PyDoc_STRVAR(audioop_adpcm2lin__doc__, "Decode an Intel/DVI ADPCM coded fragment to a linear fragment."); #define AUDIOOP_ADPCM2LIN_METHODDEF \ - {"adpcm2lin", (PyCFunction)audioop_adpcm2lin, METH_VARARGS, audioop_adpcm2lin__doc__}, + {"adpcm2lin", (PyCFunction)audioop_adpcm2lin, METH_FASTCALL, audioop_adpcm2lin__doc__}, static PyObject * audioop_adpcm2lin_impl(PyObject *module, Py_buffer *fragment, int width, PyObject *state); static PyObject * -audioop_adpcm2lin(PyObject *module, PyObject *args) +audioop_adpcm2lin(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer fragment = {NULL, NULL}; int width; PyObject *state; - if (!PyArg_ParseTuple(args, "y*iO:adpcm2lin", + if (!_PyArg_ParseStack(args, nargs, "y*iO:adpcm2lin", &fragment, &width, &state)) { goto exit; } + + if (!_PyArg_NoStackKeywords("adpcm2lin", kwnames)) { + goto exit; + } return_value = audioop_adpcm2lin_impl(module, &fragment, width, state); exit: @@ -926,4 +1032,4 @@ exit: return return_value; } -/*[clinic end generated code: output=e0ab74c3fa57c39c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ee7c63ec28a11b78 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/binascii.inc b/third_party/python/Modules/clinic/binascii.inc index 2a3cb869f..570d4c115 100644 --- a/third_party/python/Modules/clinic/binascii.inc +++ b/third_party/python/Modules/clinic/binascii.inc @@ -267,23 +267,27 @@ PyDoc_STRVAR(binascii_crc_hqx__doc__, "Compute CRC-CCITT incrementally."); #define BINASCII_CRC_HQX_METHODDEF \ - {"crc_hqx", (PyCFunction)binascii_crc_hqx, METH_VARARGS, binascii_crc_hqx__doc__}, + {"crc_hqx", (PyCFunction)binascii_crc_hqx, METH_FASTCALL, binascii_crc_hqx__doc__}, static unsigned int binascii_crc_hqx_impl(PyObject *module, Py_buffer *data, unsigned int crc); static PyObject * -binascii_crc_hqx(PyObject *module, PyObject *args) +binascii_crc_hqx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; unsigned int crc; unsigned int _return_value; - if (!PyArg_ParseTuple(args, "y*I:crc_hqx", + if (!_PyArg_ParseStack(args, nargs, "y*I:crc_hqx", &data, &crc)) { goto exit; } + + if (!_PyArg_NoStackKeywords("crc_hqx", kwnames)) { + goto exit; + } _return_value = binascii_crc_hqx_impl(module, &data, crc); if ((_return_value == (unsigned int)-1) && PyErr_Occurred()) { goto exit; @@ -306,23 +310,27 @@ PyDoc_STRVAR(binascii_crc32__doc__, "Compute CRC-32 incrementally."); #define BINASCII_CRC32_METHODDEF \ - {"crc32", (PyCFunction)binascii_crc32, METH_VARARGS, binascii_crc32__doc__}, + {"crc32", (PyCFunction)binascii_crc32, METH_FASTCALL, binascii_crc32__doc__}, static unsigned int binascii_crc32_impl(PyObject *module, Py_buffer *data, unsigned int crc); static PyObject * -binascii_crc32(PyObject *module, PyObject *args) +binascii_crc32(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; unsigned int crc = 0; unsigned int _return_value; - if (!PyArg_ParseTuple(args, "y*|I:crc32", + if (!_PyArg_ParseStack(args, nargs, "y*|I:crc32", &data, &crc)) { goto exit; } + + if (!_PyArg_NoStackKeywords("crc32", kwnames)) { + goto exit; + } _return_value = binascii_crc32_impl(module, &data, crc); if ((_return_value == (unsigned int)-1) && PyErr_Occurred()) { goto exit; @@ -551,4 +559,4 @@ exit: return return_value; } -/*[clinic end generated code: output=458eb09731cb7877 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4a418f883ccc79fe input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/cmathmodule.inc b/third_party/python/Modules/clinic/cmathmodule.inc index 5606edfaf..2f56b9496 100644 --- a/third_party/python/Modules/clinic/cmathmodule.inc +++ b/third_party/python/Modules/clinic/cmathmodule.inc @@ -642,22 +642,26 @@ PyDoc_STRVAR(cmath_log__doc__, "If the base not specified, returns the natural logarithm (base e) of z."); #define CMATH_LOG_METHODDEF \ - {"log", (PyCFunction)cmath_log, METH_VARARGS, cmath_log__doc__}, + {"log", (PyCFunction)cmath_log, METH_FASTCALL, cmath_log__doc__}, static PyObject * cmath_log_impl(PyObject *module, Py_complex x, PyObject *y_obj); static PyObject * -cmath_log(PyObject *module, PyObject *args) +cmath_log(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_complex x; PyObject *y_obj = NULL; - if (!PyArg_ParseTuple(args, "D|O:log", + if (!_PyArg_ParseStack(args, nargs, "D|O:log", &x, &y_obj)) { goto exit; } + + if (!_PyArg_NoStackKeywords("log", kwnames)) { + goto exit; + } return_value = cmath_log_impl(module, x, y_obj); exit: @@ -727,22 +731,26 @@ PyDoc_STRVAR(cmath_rect__doc__, "Convert from polar coordinates to rectangular coordinates."); #define CMATH_RECT_METHODDEF \ - {"rect", (PyCFunction)cmath_rect, METH_VARARGS, cmath_rect__doc__}, + {"rect", (PyCFunction)cmath_rect, METH_FASTCALL, cmath_rect__doc__}, static PyObject * cmath_rect_impl(PyObject *module, double r, double phi); static PyObject * -cmath_rect(PyObject *module, PyObject *args) +cmath_rect(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; double r; double phi; - if (!PyArg_ParseTuple(args, "dd:rect", + if (!_PyArg_ParseStack(args, nargs, "dd:rect", &r, &phi)) { goto exit; } + + if (!_PyArg_NoStackKeywords("rect", kwnames)) { + goto exit; + } return_value = cmath_rect_impl(module, r, phi); exit: @@ -883,4 +891,4 @@ cmath_isclose(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn exit: return return_value; } -/*[clinic end generated code: output=978f59702b41655f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=93eff5d4c242ee57 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/fcntlmodule.inc b/third_party/python/Modules/clinic/fcntlmodule.inc index 15d5f8312..24ca699f1 100644 --- a/third_party/python/Modules/clinic/fcntlmodule.inc +++ b/third_party/python/Modules/clinic/fcntlmodule.inc @@ -20,23 +20,27 @@ PyDoc_STRVAR(fcntl_fcntl__doc__, "corresponding to the return value of the fcntl call in the C code."); #define FCNTL_FCNTL_METHODDEF \ - {"fcntl", (PyCFunction)fcntl_fcntl, METH_VARARGS, fcntl_fcntl__doc__}, + {"fcntl", (PyCFunction)fcntl_fcntl, METH_FASTCALL, fcntl_fcntl__doc__}, static PyObject * fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg); static PyObject * -fcntl_fcntl(PyObject *module, PyObject *args) +fcntl_fcntl(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; int code; PyObject *arg = NULL; - if (!PyArg_ParseTuple(args, "O&i|O:fcntl", + if (!_PyArg_ParseStack(args, nargs, "O&i|O:fcntl", conv_descriptor, &fd, &code, &arg)) { goto exit; } + + if (!_PyArg_NoStackKeywords("fcntl", kwnames)) { + goto exit; + } return_value = fcntl_fcntl_impl(module, fd, code, arg); exit: @@ -77,14 +81,14 @@ PyDoc_STRVAR(fcntl_ioctl__doc__, "code."); #define FCNTL_IOCTL_METHODDEF \ - {"ioctl", (PyCFunction)fcntl_ioctl, METH_VARARGS, fcntl_ioctl__doc__}, + {"ioctl", (PyCFunction)fcntl_ioctl, METH_FASTCALL, fcntl_ioctl__doc__}, static PyObject * fcntl_ioctl_impl(PyObject *module, int fd, unsigned int code, PyObject *ob_arg, int mutate_arg); static PyObject * -fcntl_ioctl(PyObject *module, PyObject *args) +fcntl_ioctl(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; @@ -92,10 +96,14 @@ fcntl_ioctl(PyObject *module, PyObject *args) PyObject *ob_arg = NULL; int mutate_arg = 1; - if (!PyArg_ParseTuple(args, "O&I|Op:ioctl", + if (!_PyArg_ParseStack(args, nargs, "O&I|Op:ioctl", conv_descriptor, &fd, &code, &ob_arg, &mutate_arg)) { goto exit; } + + if (!_PyArg_NoStackKeywords("ioctl", kwnames)) { + goto exit; + } return_value = fcntl_ioctl_impl(module, fd, code, ob_arg, mutate_arg); exit: @@ -112,22 +120,26 @@ PyDoc_STRVAR(fcntl_flock__doc__, "function is emulated using fcntl())."); #define FCNTL_FLOCK_METHODDEF \ - {"flock", (PyCFunction)fcntl_flock, METH_VARARGS, fcntl_flock__doc__}, + {"flock", (PyCFunction)fcntl_flock, METH_FASTCALL, fcntl_flock__doc__}, static PyObject * fcntl_flock_impl(PyObject *module, int fd, int code); static PyObject * -fcntl_flock(PyObject *module, PyObject *args) +fcntl_flock(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; int code; - if (!PyArg_ParseTuple(args, "O&i:flock", + if (!_PyArg_ParseStack(args, nargs, "O&i:flock", conv_descriptor, &fd, &code)) { goto exit; } + + if (!_PyArg_NoStackKeywords("flock", kwnames)) { + goto exit; + } return_value = fcntl_flock_impl(module, fd, code); exit: @@ -162,14 +174,14 @@ PyDoc_STRVAR(fcntl_lockf__doc__, " 2 - relative to the end of the file (SEEK_END)"); #define FCNTL_LOCKF_METHODDEF \ - {"lockf", (PyCFunction)fcntl_lockf, METH_VARARGS, fcntl_lockf__doc__}, + {"lockf", (PyCFunction)fcntl_lockf, METH_FASTCALL, fcntl_lockf__doc__}, static PyObject * fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj, PyObject *startobj, int whence); static PyObject * -fcntl_lockf(PyObject *module, PyObject *args) +fcntl_lockf(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; @@ -178,13 +190,17 @@ fcntl_lockf(PyObject *module, PyObject *args) PyObject *startobj = NULL; int whence = 0; - if (!PyArg_ParseTuple(args, "O&i|OOi:lockf", + if (!_PyArg_ParseStack(args, nargs, "O&i|OOi:lockf", conv_descriptor, &fd, &code, &lenobj, &startobj, &whence)) { goto exit; } + + if (!_PyArg_NoStackKeywords("lockf", kwnames)) { + goto exit; + } return_value = fcntl_lockf_impl(module, fd, code, lenobj, startobj, whence); exit: return return_value; } -/*[clinic end generated code: output=36cff76a8fb2c9a6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b67e9579722e6d4f input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/grpmodule.inc b/third_party/python/Modules/clinic/grpmodule.inc index 6df0dd854..5e4a02dcb 100644 --- a/third_party/python/Modules/clinic/grpmodule.inc +++ b/third_party/python/Modules/clinic/grpmodule.inc @@ -87,4 +87,4 @@ grp_getgrall(PyObject *module, PyObject *Py_UNUSED(ignored)) { return grp_getgrall_impl(module); } -/*[clinic end generated code: output=d6417ae0a7298e0e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fb690db5e676d378 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/posixmodule.inc b/third_party/python/Modules/clinic/posixmodule.inc index fc19e5c05..4850df894 100644 --- a/third_party/python/Modules/clinic/posixmodule.inc +++ b/third_party/python/Modules/clinic/posixmodule.inc @@ -2,12 +2,6 @@ /*[clinic input] preserve [clinic start generated code]*/ -#include "third_party/python/pyconfig.h" -#include "third_party/python/pyconfig.h" -#include "third_party/python/pyconfig.h" -#include "third_party/python/pyconfig.h" -#include "third_party/python/pyconfig.h" -#include "third_party/python/pyconfig.h" PyDoc_STRVAR(os_stat__doc__, "stat($module, /, path, *, dir_fd=None, follow_symlinks=True)\n" @@ -144,7 +138,7 @@ os_access(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames { PyObject *return_value = NULL; static const char * const _keywords[] = {"path", "mode", "dir_fd", "effective_ids", "follow_symlinks", NULL}; - static _PyArg_Parser _parser = {"O&I|$O&pp:access", _keywords, 0}; + static _PyArg_Parser _parser = {"O&i|$O&pp:access", _keywords, 0}; path_t path = PATH_T_INITIALIZE("access", "path", 0, 0); int mode; int dir_fd = DEFAULT_DIR_FD; @@ -934,6 +928,33 @@ exit: return return_value; } +PyDoc_STRVAR(os__getfinalpathname__doc__, +"_getfinalpathname($module, path, /)\n" +"--\n" +"\n" +"A helper function for samepath on windows."); + +#define OS__GETFINALPATHNAME_METHODDEF \ + {"_getfinalpathname", (PyCFunction)os__getfinalpathname, METH_O, os__getfinalpathname__doc__}, + +static PyObject * +os__getfinalpathname_impl(PyObject *module, PyObject *path); + +static PyObject * +os__getfinalpathname(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *path; + + if (!PyArg_Parse(arg, "U:_getfinalpathname", &path)) { + goto exit; + } + return_value = os__getfinalpathname_impl(module, path); + +exit: + return return_value; +} + #if defined(MS_WINDOWS) PyDoc_STRVAR(os__getfullpathname__doc__, @@ -967,31 +988,6 @@ exit: #endif /* defined(MS_WINDOWS) */ -PyDoc_STRVAR(os__getfinalpathname__doc__, -"_getfinalpathname($module, path, /)\n" -"--\n" -"\n" -"A helper function for samepath on windows."); - -#define OS__GETFINALPATHNAME_METHODDEF \ - {"_getfinalpathname", (PyCFunction)os__getfinalpathname, METH_O, os__getfinalpathname__doc__}, - -static PyObject * -os__getfinalpathname_impl(PyObject *module, PyObject *path); - -static PyObject * -os__getfinalpathname(PyObject *module, PyObject *arg) -{ - PyObject *return_value = NULL; - PyObject *path; - if (!PyArg_Parse(arg, "U:_getfinalpathname", &path)) { - goto exit; - } - return_value = os__getfinalpathname_impl(module, path); -exit: - return return_value; -} - #if defined(MS_WINDOWS) PyDoc_STRVAR(os__isdir__doc__, @@ -1011,13 +1007,16 @@ os__isdir(PyObject *module, PyObject *arg) { PyObject *return_value = NULL; path_t path = PATH_T_INITIALIZE("_isdir", "path", 0, 0); + if (!PyArg_Parse(arg, "O&:_isdir", path_converter, &path)) { goto exit; } return_value = os__isdir_impl(module, &path); + exit: /* Cleanup for path */ path_cleanup(&path); + return return_value; } @@ -1042,11 +1041,13 @@ os__getvolumepathname(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObj static const char * const _keywords[] = {"path", NULL}; static _PyArg_Parser _parser = {"U:_getvolumepathname", _keywords, 0}; PyObject *path; + if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, &path)) { goto exit; } return_value = os__getvolumepathname_impl(module, path); + exit: return return_value; } @@ -1640,22 +1641,26 @@ PyDoc_STRVAR(os_execv__doc__, " Tuple or list of strings."); #define OS_EXECV_METHODDEF \ - {"execv", (PyCFunction)os_execv, METH_VARARGS, os_execv__doc__}, + {"execv", (PyCFunction)os_execv, METH_FASTCALL, os_execv__doc__}, static PyObject * os_execv_impl(PyObject *module, path_t *path, PyObject *argv); static PyObject * -os_execv(PyObject *module, PyObject *args) +os_execv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; path_t path = PATH_T_INITIALIZE("execv", "path", 0, 0); PyObject *argv; - if (!PyArg_ParseTuple(args, "O&O:execv", + if (!_PyArg_ParseStack(args, nargs, "O&O:execv", path_converter, &path, &argv)) { goto exit; } + + if (!_PyArg_NoStackKeywords("execv", kwnames)) { + goto exit; + } return_value = os_execv_impl(module, &path, argv); exit: @@ -1729,23 +1734,27 @@ PyDoc_STRVAR(os_spawnv__doc__, " Tuple or list of strings."); #define OS_SPAWNV_METHODDEF \ - {"spawnv", (PyCFunction)os_spawnv, METH_VARARGS, os_spawnv__doc__}, + {"spawnv", (PyCFunction)os_spawnv, METH_FASTCALL, os_spawnv__doc__}, static PyObject * os_spawnv_impl(PyObject *module, int mode, path_t *path, PyObject *argv); static PyObject * -os_spawnv(PyObject *module, PyObject *args) +os_spawnv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int mode; path_t path = PATH_T_INITIALIZE("spawnv", "path", 0, 0); PyObject *argv; - if (!PyArg_ParseTuple(args, "iO&O:spawnv", + if (!_PyArg_ParseStack(args, nargs, "iO&O:spawnv", &mode, path_converter, &path, &argv)) { goto exit; } + + if (!_PyArg_NoStackKeywords("spawnv", kwnames)) { + goto exit; + } return_value = os_spawnv_impl(module, mode, &path, argv); exit: @@ -1775,14 +1784,14 @@ PyDoc_STRVAR(os_spawnve__doc__, " Dictionary of strings mapping to strings."); #define OS_SPAWNVE_METHODDEF \ - {"spawnve", (PyCFunction)os_spawnve, METH_VARARGS, os_spawnve__doc__}, + {"spawnve", (PyCFunction)os_spawnve, METH_FASTCALL, os_spawnve__doc__}, static PyObject * os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv, PyObject *env); static PyObject * -os_spawnve(PyObject *module, PyObject *args) +os_spawnve(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int mode; @@ -1790,10 +1799,14 @@ os_spawnve(PyObject *module, PyObject *args) PyObject *argv; PyObject *env; - if (!PyArg_ParseTuple(args, "iO&OO:spawnve", + if (!_PyArg_ParseStack(args, nargs, "iO&OO:spawnve", &mode, path_converter, &path, &argv, &env)) { goto exit; } + + if (!_PyArg_NoStackKeywords("spawnve", kwnames)) { + goto exit; + } return_value = os_spawnve_impl(module, mode, &path, argv, env); exit: @@ -2000,24 +2013,28 @@ PyDoc_STRVAR(os_sched_setscheduler__doc__, "param is an instance of sched_param."); #define OS_SCHED_SETSCHEDULER_METHODDEF \ - {"sched_setscheduler", (PyCFunction)os_sched_setscheduler, METH_VARARGS, os_sched_setscheduler__doc__}, + {"sched_setscheduler", (PyCFunction)os_sched_setscheduler, METH_FASTCALL, os_sched_setscheduler__doc__}, static PyObject * os_sched_setscheduler_impl(PyObject *module, pid_t pid, int policy, struct sched_param *param); static PyObject * -os_sched_setscheduler(PyObject *module, PyObject *args) +os_sched_setscheduler(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; pid_t pid; int policy; struct sched_param param; - if (!PyArg_ParseTuple(args, "" _Py_PARSE_PID "iO&:sched_setscheduler", + if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "iO&:sched_setscheduler", &pid, &policy, convert_sched_param, ¶m)) { goto exit; } + + if (!_PyArg_NoStackKeywords("sched_setscheduler", kwnames)) { + goto exit; + } return_value = os_sched_setscheduler_impl(module, pid, policy, ¶m); exit: @@ -2072,23 +2089,27 @@ PyDoc_STRVAR(os_sched_setparam__doc__, "param should be an instance of sched_param."); #define OS_SCHED_SETPARAM_METHODDEF \ - {"sched_setparam", (PyCFunction)os_sched_setparam, METH_VARARGS, os_sched_setparam__doc__}, + {"sched_setparam", (PyCFunction)os_sched_setparam, METH_FASTCALL, os_sched_setparam__doc__}, static PyObject * os_sched_setparam_impl(PyObject *module, pid_t pid, struct sched_param *param); static PyObject * -os_sched_setparam(PyObject *module, PyObject *args) +os_sched_setparam(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; pid_t pid; struct sched_param param; - if (!PyArg_ParseTuple(args, "" _Py_PARSE_PID "O&:sched_setparam", + if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "O&:sched_setparam", &pid, convert_sched_param, ¶m)) { goto exit; } + + if (!_PyArg_NoStackKeywords("sched_setparam", kwnames)) { + goto exit; + } return_value = os_sched_setparam_impl(module, pid, ¶m); exit: @@ -2164,22 +2185,26 @@ PyDoc_STRVAR(os_sched_setaffinity__doc__, "mask should be an iterable of integers identifying CPUs."); #define OS_SCHED_SETAFFINITY_METHODDEF \ - {"sched_setaffinity", (PyCFunction)os_sched_setaffinity, METH_VARARGS, os_sched_setaffinity__doc__}, + {"sched_setaffinity", (PyCFunction)os_sched_setaffinity, METH_FASTCALL, os_sched_setaffinity__doc__}, static PyObject * os_sched_setaffinity_impl(PyObject *module, pid_t pid, PyObject *mask); static PyObject * -os_sched_setaffinity(PyObject *module, PyObject *args) +os_sched_setaffinity(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; pid_t pid; PyObject *mask; - if (!PyArg_ParseTuple(args, "" _Py_PARSE_PID "O:sched_setaffinity", + if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "O:sched_setaffinity", &pid, &mask)) { goto exit; } + + if (!_PyArg_NoStackKeywords("sched_setaffinity", kwnames)) { + goto exit; + } return_value = os_sched_setaffinity_impl(module, pid, mask); exit: @@ -2246,7 +2271,7 @@ os_openpty(PyObject *module, PyObject *Py_UNUSED(ignored)) #endif /* (defined(HAVE_OPENPTY) || defined(HAVE__GETPTY) || defined(HAVE_DEV_PTMX)) */ -#if defined(HAVE_FORKPTY) +#if (HAVE_FORKPTY) PyDoc_STRVAR(os_forkpty__doc__, "forkpty($module, /)\n" @@ -2271,7 +2296,7 @@ os_forkpty(PyObject *module, PyObject *Py_UNUSED(ignored)) return os_forkpty_impl(module); } -#endif /* defined(HAVE_FORKPTY) */ +#endif /* (HAVE_FORKPTY) */ #if defined(HAVE_GETEGID) @@ -2539,22 +2564,26 @@ PyDoc_STRVAR(os_kill__doc__, "Kill a process with a signal."); #define OS_KILL_METHODDEF \ - {"kill", (PyCFunction)os_kill, METH_VARARGS, os_kill__doc__}, + {"kill", (PyCFunction)os_kill, METH_FASTCALL, os_kill__doc__}, static PyObject * os_kill_impl(PyObject *module, pid_t pid, Py_ssize_t signal); static PyObject * -os_kill(PyObject *module, PyObject *args) +os_kill(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; pid_t pid; Py_ssize_t signal; - if (!PyArg_ParseTuple(args, "" _Py_PARSE_PID "n:kill", + if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "n:kill", &pid, &signal)) { goto exit; } + + if (!_PyArg_NoStackKeywords("kill", kwnames)) { + goto exit; + } return_value = os_kill_impl(module, pid, signal); exit: @@ -2572,22 +2601,26 @@ PyDoc_STRVAR(os_killpg__doc__, "Kill a process group with a signal."); #define OS_KILLPG_METHODDEF \ - {"killpg", (PyCFunction)os_killpg, METH_VARARGS, os_killpg__doc__}, + {"killpg", (PyCFunction)os_killpg, METH_FASTCALL, os_killpg__doc__}, static PyObject * os_killpg_impl(PyObject *module, pid_t pgid, int signal); static PyObject * -os_killpg(PyObject *module, PyObject *args) +os_killpg(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; pid_t pgid; int signal; - if (!PyArg_ParseTuple(args, "" _Py_PARSE_PID "i:killpg", + if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "i:killpg", &pgid, &signal)) { goto exit; } + + if (!_PyArg_NoStackKeywords("killpg", kwnames)) { + goto exit; + } return_value = os_killpg_impl(module, pgid, signal); exit: @@ -2729,22 +2762,26 @@ PyDoc_STRVAR(os_setreuid__doc__, "Set the current process\'s real and effective user ids."); #define OS_SETREUID_METHODDEF \ - {"setreuid", (PyCFunction)os_setreuid, METH_VARARGS, os_setreuid__doc__}, + {"setreuid", (PyCFunction)os_setreuid, METH_FASTCALL, os_setreuid__doc__}, static PyObject * os_setreuid_impl(PyObject *module, uid_t ruid, uid_t euid); static PyObject * -os_setreuid(PyObject *module, PyObject *args) +os_setreuid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; uid_t ruid; uid_t euid; - if (!PyArg_ParseTuple(args, "O&O&:setreuid", + if (!_PyArg_ParseStack(args, nargs, "O&O&:setreuid", _Py_Uid_Converter, &ruid, _Py_Uid_Converter, &euid)) { goto exit; } + + if (!_PyArg_NoStackKeywords("setreuid", kwnames)) { + goto exit; + } return_value = os_setreuid_impl(module, ruid, euid); exit: @@ -2762,22 +2799,26 @@ PyDoc_STRVAR(os_setregid__doc__, "Set the current process\'s real and effective group ids."); #define OS_SETREGID_METHODDEF \ - {"setregid", (PyCFunction)os_setregid, METH_VARARGS, os_setregid__doc__}, + {"setregid", (PyCFunction)os_setregid, METH_FASTCALL, os_setregid__doc__}, static PyObject * os_setregid_impl(PyObject *module, gid_t rgid, gid_t egid); static PyObject * -os_setregid(PyObject *module, PyObject *args) +os_setregid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; gid_t rgid; gid_t egid; - if (!PyArg_ParseTuple(args, "O&O&:setregid", + if (!_PyArg_ParseStack(args, nargs, "O&O&:setregid", _Py_Gid_Converter, &rgid, _Py_Gid_Converter, &egid)) { goto exit; } + + if (!_PyArg_NoStackKeywords("setregid", kwnames)) { + goto exit; + } return_value = os_setregid_impl(module, rgid, egid); exit: @@ -2817,7 +2858,7 @@ exit: #endif /* defined(HAVE_SETGID) */ -#if defined(HAVE_SETGROUPS) +#if (HAVE_SETGROUPS) PyDoc_STRVAR(os_setgroups__doc__, "setgroups($module, groups, /)\n" @@ -2828,7 +2869,7 @@ PyDoc_STRVAR(os_setgroups__doc__, #define OS_SETGROUPS_METHODDEF \ {"setgroups", (PyCFunction)os_setgroups, METH_O, os_setgroups__doc__}, -#endif /* defined(HAVE_SETGROUPS) */ +#endif /* (HAVE_SETGROUPS) */ #if defined(HAVE_WAIT3) @@ -2925,23 +2966,27 @@ PyDoc_STRVAR(os_waitid__doc__, "no children in a waitable state."); #define OS_WAITID_METHODDEF \ - {"waitid", (PyCFunction)os_waitid, METH_VARARGS, os_waitid__doc__}, + {"waitid", (PyCFunction)os_waitid, METH_FASTCALL, os_waitid__doc__}, static PyObject * os_waitid_impl(PyObject *module, idtype_t idtype, id_t id, int options); static PyObject * -os_waitid(PyObject *module, PyObject *args) +os_waitid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; idtype_t idtype; id_t id; int options; - if (!PyArg_ParseTuple(args, "i" _Py_PARSE_PID "i:waitid", + if (!_PyArg_ParseStack(args, nargs, "i" _Py_PARSE_PID "i:waitid", &idtype, &id, &options)) { goto exit; } + + if (!_PyArg_NoStackKeywords("waitid", kwnames)) { + goto exit; + } return_value = os_waitid_impl(module, idtype, id, options); exit: @@ -2964,22 +3009,26 @@ PyDoc_STRVAR(os_waitpid__doc__, "The options argument is ignored on Windows."); #define OS_WAITPID_METHODDEF \ - {"waitpid", (PyCFunction)os_waitpid, METH_VARARGS, os_waitpid__doc__}, + {"waitpid", (PyCFunction)os_waitpid, METH_FASTCALL, os_waitpid__doc__}, static PyObject * os_waitpid_impl(PyObject *module, pid_t pid, int options); static PyObject * -os_waitpid(PyObject *module, PyObject *args) +os_waitpid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; pid_t pid; int options; - if (!PyArg_ParseTuple(args, "" _Py_PARSE_PID "i:waitpid", + if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "i:waitpid", &pid, &options)) { goto exit; } + + if (!_PyArg_NoStackKeywords("waitpid", kwnames)) { + goto exit; + } return_value = os_waitpid_impl(module, pid, options); exit: @@ -3002,22 +3051,26 @@ PyDoc_STRVAR(os_waitpid__doc__, "The options argument is ignored on Windows."); #define OS_WAITPID_METHODDEF \ - {"waitpid", (PyCFunction)os_waitpid, METH_VARARGS, os_waitpid__doc__}, + {"waitpid", (PyCFunction)os_waitpid, METH_FASTCALL, os_waitpid__doc__}, static PyObject * os_waitpid_impl(PyObject *module, intptr_t pid, int options); static PyObject * -os_waitpid(PyObject *module, PyObject *args) +os_waitpid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; intptr_t pid; int options; - if (!PyArg_ParseTuple(args, "" _Py_PARSE_INTPTR "i:waitpid", + if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_INTPTR "i:waitpid", &pid, &options)) { goto exit; } + + if (!_PyArg_NoStackKeywords("waitpid", kwnames)) { + goto exit; + } return_value = os_waitpid_impl(module, pid, options); exit: @@ -3192,22 +3245,26 @@ PyDoc_STRVAR(os_setpgid__doc__, "Call the system call setpgid(pid, pgrp)."); #define OS_SETPGID_METHODDEF \ - {"setpgid", (PyCFunction)os_setpgid, METH_VARARGS, os_setpgid__doc__}, + {"setpgid", (PyCFunction)os_setpgid, METH_FASTCALL, os_setpgid__doc__}, static PyObject * os_setpgid_impl(PyObject *module, pid_t pid, pid_t pgrp); static PyObject * -os_setpgid(PyObject *module, PyObject *args) +os_setpgid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; pid_t pid; pid_t pgrp; - if (!PyArg_ParseTuple(args, "" _Py_PARSE_PID "" _Py_PARSE_PID ":setpgid", + if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "" _Py_PARSE_PID ":setpgid", &pid, &pgrp)) { goto exit; } + + if (!_PyArg_NoStackKeywords("setpgid", kwnames)) { + goto exit; + } return_value = os_setpgid_impl(module, pid, pgrp); exit: @@ -3256,22 +3313,26 @@ PyDoc_STRVAR(os_tcsetpgrp__doc__, "Set the process group associated with the terminal specified by fd."); #define OS_TCSETPGRP_METHODDEF \ - {"tcsetpgrp", (PyCFunction)os_tcsetpgrp, METH_VARARGS, os_tcsetpgrp__doc__}, + {"tcsetpgrp", (PyCFunction)os_tcsetpgrp, METH_FASTCALL, os_tcsetpgrp__doc__}, static PyObject * os_tcsetpgrp_impl(PyObject *module, int fd, pid_t pgid); static PyObject * -os_tcsetpgrp(PyObject *module, PyObject *args) +os_tcsetpgrp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; pid_t pgid; - if (!PyArg_ParseTuple(args, "i" _Py_PARSE_PID ":tcsetpgrp", + if (!_PyArg_ParseStack(args, nargs, "i" _Py_PARSE_PID ":tcsetpgrp", &fd, &pgid)) { goto exit; } + + if (!_PyArg_NoStackKeywords("tcsetpgrp", kwnames)) { + goto exit; + } return_value = os_tcsetpgrp_impl(module, fd, pgid); exit: @@ -3302,9 +3363,9 @@ os_open(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; static const char * const _keywords[] = {"path", "flags", "mode", "dir_fd", NULL}; - static _PyArg_Parser _parser = {"O&I|i$O&:open", _keywords, 0}; + static _PyArg_Parser _parser = {"O&i|i$O&:open", _keywords, 0}; path_t path = PATH_T_INITIALIZE("open", "path", 0, 0); - unsigned flags; + int flags; int mode = 511; int dir_fd = DEFAULT_DIR_FD; int _return_value; @@ -3363,22 +3424,26 @@ PyDoc_STRVAR(os_closerange__doc__, "Closes all file descriptors in [fd_low, fd_high), ignoring errors."); #define OS_CLOSERANGE_METHODDEF \ - {"closerange", (PyCFunction)os_closerange, METH_VARARGS, os_closerange__doc__}, + {"closerange", (PyCFunction)os_closerange, METH_FASTCALL, os_closerange__doc__}, static PyObject * os_closerange_impl(PyObject *module, int fd_low, int fd_high); static PyObject * -os_closerange(PyObject *module, PyObject *args) +os_closerange(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd_low; int fd_high; - if (!PyArg_ParseTuple(args, "ii:closerange", + if (!_PyArg_ParseStack(args, nargs, "ii:closerange", &fd_low, &fd_high)) { goto exit; } + + if (!_PyArg_NoStackKeywords("closerange", kwnames)) { + goto exit; + } return_value = os_closerange_impl(module, fd_low, fd_high); exit: @@ -3465,23 +3530,27 @@ PyDoc_STRVAR(os_lockf__doc__, " The number of bytes to lock, starting at the current position."); #define OS_LOCKF_METHODDEF \ - {"lockf", (PyCFunction)os_lockf, METH_VARARGS, os_lockf__doc__}, + {"lockf", (PyCFunction)os_lockf, METH_FASTCALL, os_lockf__doc__}, static PyObject * os_lockf_impl(PyObject *module, int fd, int command, Py_off_t length); static PyObject * -os_lockf(PyObject *module, PyObject *args) +os_lockf(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; int command; Py_off_t length; - if (!PyArg_ParseTuple(args, "iiO&:lockf", + if (!_PyArg_ParseStack(args, nargs, "iiO&:lockf", &fd, &command, Py_off_t_converter, &length)) { goto exit; } + + if (!_PyArg_NoStackKeywords("lockf", kwnames)) { + goto exit; + } return_value = os_lockf_impl(module, fd, command, length); exit: @@ -3500,13 +3569,13 @@ PyDoc_STRVAR(os_lseek__doc__, "relative to the beginning of the file."); #define OS_LSEEK_METHODDEF \ - {"lseek", (PyCFunction)os_lseek, METH_VARARGS, os_lseek__doc__}, + {"lseek", (PyCFunction)os_lseek, METH_FASTCALL, os_lseek__doc__}, static Py_off_t os_lseek_impl(PyObject *module, int fd, Py_off_t position, int how); static PyObject * -os_lseek(PyObject *module, PyObject *args) +os_lseek(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; @@ -3514,10 +3583,14 @@ os_lseek(PyObject *module, PyObject *args) int how; Py_off_t _return_value; - if (!PyArg_ParseTuple(args, "iO&i:lseek", + if (!_PyArg_ParseStack(args, nargs, "iO&i:lseek", &fd, Py_off_t_converter, &position, &how)) { goto exit; } + + if (!_PyArg_NoStackKeywords("lseek", kwnames)) { + goto exit; + } _return_value = os_lseek_impl(module, fd, position, how); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; @@ -3535,22 +3608,26 @@ PyDoc_STRVAR(os_read__doc__, "Read from a file descriptor. Returns a bytes object."); #define OS_READ_METHODDEF \ - {"read", (PyCFunction)os_read, METH_VARARGS, os_read__doc__}, + {"read", (PyCFunction)os_read, METH_FASTCALL, os_read__doc__}, static PyObject * os_read_impl(PyObject *module, int fd, Py_ssize_t length); static PyObject * -os_read(PyObject *module, PyObject *args) +os_read(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; Py_ssize_t length; - if (!PyArg_ParseTuple(args, "in:read", + if (!_PyArg_ParseStack(args, nargs, "in:read", &fd, &length)) { goto exit; } + + if (!_PyArg_NoStackKeywords("read", kwnames)) { + goto exit; + } return_value = os_read_impl(module, fd, length); exit: @@ -3574,23 +3651,27 @@ PyDoc_STRVAR(os_readv__doc__, "which may be less than the total capacity of all the buffers."); #define OS_READV_METHODDEF \ - {"readv", (PyCFunction)os_readv, METH_VARARGS, os_readv__doc__}, + {"readv", (PyCFunction)os_readv, METH_FASTCALL, os_readv__doc__}, static Py_ssize_t os_readv_impl(PyObject *module, int fd, PyObject *buffers); static PyObject * -os_readv(PyObject *module, PyObject *args) +os_readv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; PyObject *buffers; Py_ssize_t _return_value; - if (!PyArg_ParseTuple(args, "iO:readv", + if (!_PyArg_ParseStack(args, nargs, "iO:readv", &fd, &buffers)) { goto exit; } + + if (!_PyArg_NoStackKeywords("readv", kwnames)) { + goto exit; + } _return_value = os_readv_impl(module, fd, buffers); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; @@ -3615,23 +3696,27 @@ PyDoc_STRVAR(os_pread__doc__, "the beginning of the file. The file offset remains unchanged."); #define OS_PREAD_METHODDEF \ - {"pread", (PyCFunction)os_pread, METH_VARARGS, os_pread__doc__}, + {"pread", (PyCFunction)os_pread, METH_FASTCALL, os_pread__doc__}, static PyObject * os_pread_impl(PyObject *module, int fd, int length, Py_off_t offset); static PyObject * -os_pread(PyObject *module, PyObject *args) +os_pread(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; int length; Py_off_t offset; - if (!PyArg_ParseTuple(args, "iiO&:pread", + if (!_PyArg_ParseStack(args, nargs, "iiO&:pread", &fd, &length, Py_off_t_converter, &offset)) { goto exit; } + + if (!_PyArg_NoStackKeywords("pread", kwnames)) { + goto exit; + } return_value = os_pread_impl(module, fd, length, offset); exit: @@ -3647,23 +3732,27 @@ PyDoc_STRVAR(os_write__doc__, "Write a bytes object to a file descriptor."); #define OS_WRITE_METHODDEF \ - {"write", (PyCFunction)os_write, METH_VARARGS, os_write__doc__}, + {"write", (PyCFunction)os_write, METH_FASTCALL, os_write__doc__}, static Py_ssize_t os_write_impl(PyObject *module, int fd, Py_buffer *data); static PyObject * -os_write(PyObject *module, PyObject *args) +os_write(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; Py_buffer data = {NULL, NULL}; Py_ssize_t _return_value; - if (!PyArg_ParseTuple(args, "iy*:write", + if (!_PyArg_ParseStack(args, nargs, "iy*:write", &fd, &data)) { goto exit; } + + if (!_PyArg_NoStackKeywords("write", kwnames)) { + goto exit; + } _return_value = os_write_impl(module, fd, &data); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; @@ -3821,23 +3910,27 @@ PyDoc_STRVAR(os_writev__doc__, "buffers must be a sequence of bytes-like objects."); #define OS_WRITEV_METHODDEF \ - {"writev", (PyCFunction)os_writev, METH_VARARGS, os_writev__doc__}, + {"writev", (PyCFunction)os_writev, METH_FASTCALL, os_writev__doc__}, static Py_ssize_t os_writev_impl(PyObject *module, int fd, PyObject *buffers); static PyObject * -os_writev(PyObject *module, PyObject *args) +os_writev(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; PyObject *buffers; Py_ssize_t _return_value; - if (!PyArg_ParseTuple(args, "iO:writev", + if (!_PyArg_ParseStack(args, nargs, "iO:writev", &fd, &buffers)) { goto exit; } + + if (!_PyArg_NoStackKeywords("writev", kwnames)) { + goto exit; + } _return_value = os_writev_impl(module, fd, buffers); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; @@ -3863,13 +3956,13 @@ PyDoc_STRVAR(os_pwrite__doc__, "current file offset."); #define OS_PWRITE_METHODDEF \ - {"pwrite", (PyCFunction)os_pwrite, METH_VARARGS, os_pwrite__doc__}, + {"pwrite", (PyCFunction)os_pwrite, METH_FASTCALL, os_pwrite__doc__}, static Py_ssize_t os_pwrite_impl(PyObject *module, int fd, Py_buffer *buffer, Py_off_t offset); static PyObject * -os_pwrite(PyObject *module, PyObject *args) +os_pwrite(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; @@ -3877,10 +3970,14 @@ os_pwrite(PyObject *module, PyObject *args) Py_off_t offset; Py_ssize_t _return_value; - if (!PyArg_ParseTuple(args, "iy*O&:pwrite", + if (!_PyArg_ParseStack(args, nargs, "iy*O&:pwrite", &fd, &buffer, Py_off_t_converter, &offset)) { goto exit; } + + if (!_PyArg_NoStackKeywords("pwrite", kwnames)) { + goto exit; + } _return_value = os_pwrite_impl(module, fd, &buffer, offset); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; @@ -4076,23 +4173,27 @@ PyDoc_STRVAR(os_makedev__doc__, "Composes a raw device number from the major and minor device numbers."); #define OS_MAKEDEV_METHODDEF \ - {"makedev", (PyCFunction)os_makedev, METH_VARARGS, os_makedev__doc__}, + {"makedev", (PyCFunction)os_makedev, METH_FASTCALL, os_makedev__doc__}, static dev_t os_makedev_impl(PyObject *module, int major, int minor); static PyObject * -os_makedev(PyObject *module, PyObject *args) +os_makedev(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int major; int minor; dev_t _return_value; - if (!PyArg_ParseTuple(args, "ii:makedev", + if (!_PyArg_ParseStack(args, nargs, "ii:makedev", &major, &minor)) { goto exit; } + + if (!_PyArg_NoStackKeywords("makedev", kwnames)) { + goto exit; + } _return_value = os_makedev_impl(module, major, minor); if ((_return_value == (dev_t)-1) && PyErr_Occurred()) { goto exit; @@ -4114,22 +4215,26 @@ PyDoc_STRVAR(os_ftruncate__doc__, "Truncate a file, specified by file descriptor, to a specific length."); #define OS_FTRUNCATE_METHODDEF \ - {"ftruncate", (PyCFunction)os_ftruncate, METH_VARARGS, os_ftruncate__doc__}, + {"ftruncate", (PyCFunction)os_ftruncate, METH_FASTCALL, os_ftruncate__doc__}, static PyObject * os_ftruncate_impl(PyObject *module, int fd, Py_off_t length); static PyObject * -os_ftruncate(PyObject *module, PyObject *args) +os_ftruncate(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; Py_off_t length; - if (!PyArg_ParseTuple(args, "iO&:ftruncate", + if (!_PyArg_ParseStack(args, nargs, "iO&:ftruncate", &fd, Py_off_t_converter, &length)) { goto exit; } + + if (!_PyArg_NoStackKeywords("ftruncate", kwnames)) { + goto exit; + } return_value = os_ftruncate_impl(module, fd, length); exit: @@ -4191,24 +4296,28 @@ PyDoc_STRVAR(os_posix_fallocate__doc__, "starting at offset bytes from the beginning and continuing for length bytes."); #define OS_POSIX_FALLOCATE_METHODDEF \ - {"posix_fallocate", (PyCFunction)os_posix_fallocate, METH_VARARGS, os_posix_fallocate__doc__}, + {"posix_fallocate", (PyCFunction)os_posix_fallocate, METH_FASTCALL, os_posix_fallocate__doc__}, static PyObject * os_posix_fallocate_impl(PyObject *module, int fd, Py_off_t offset, Py_off_t length); static PyObject * -os_posix_fallocate(PyObject *module, PyObject *args) +os_posix_fallocate(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; Py_off_t offset; Py_off_t length; - if (!PyArg_ParseTuple(args, "iO&O&:posix_fallocate", + if (!_PyArg_ParseStack(args, nargs, "iO&O&:posix_fallocate", &fd, Py_off_t_converter, &offset, Py_off_t_converter, &length)) { goto exit; } + + if (!_PyArg_NoStackKeywords("posix_fallocate", kwnames)) { + goto exit; + } return_value = os_posix_fallocate_impl(module, fd, offset, length); exit: @@ -4234,14 +4343,14 @@ PyDoc_STRVAR(os_posix_fadvise__doc__, "POSIX_FADV_DONTNEED."); #define OS_POSIX_FADVISE_METHODDEF \ - {"posix_fadvise", (PyCFunction)os_posix_fadvise, METH_VARARGS, os_posix_fadvise__doc__}, + {"posix_fadvise", (PyCFunction)os_posix_fadvise, METH_FASTCALL, os_posix_fadvise__doc__}, static PyObject * os_posix_fadvise_impl(PyObject *module, int fd, Py_off_t offset, Py_off_t length, int advice); static PyObject * -os_posix_fadvise(PyObject *module, PyObject *args) +os_posix_fadvise(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; @@ -4249,10 +4358,14 @@ os_posix_fadvise(PyObject *module, PyObject *args) Py_off_t length; int advice; - if (!PyArg_ParseTuple(args, "iO&O&i:posix_fadvise", + if (!_PyArg_ParseStack(args, nargs, "iO&O&i:posix_fadvise", &fd, Py_off_t_converter, &offset, Py_off_t_converter, &length, &advice)) { goto exit; } + + if (!_PyArg_NoStackKeywords("posix_fadvise", kwnames)) { + goto exit; + } return_value = os_posix_fadvise_impl(module, fd, offset, length, advice); exit: @@ -4270,22 +4383,26 @@ PyDoc_STRVAR(os_putenv__doc__, "Change or add an environment variable."); #define OS_PUTENV_METHODDEF \ - {"putenv", (PyCFunction)os_putenv, METH_VARARGS, os_putenv__doc__}, + {"putenv", (PyCFunction)os_putenv, METH_FASTCALL, os_putenv__doc__}, static PyObject * os_putenv_impl(PyObject *module, PyObject *name, PyObject *value); static PyObject * -os_putenv(PyObject *module, PyObject *args) +os_putenv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *name; PyObject *value; - if (!PyArg_ParseTuple(args, "UU:putenv", + if (!_PyArg_ParseStack(args, nargs, "UU:putenv", &name, &value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("putenv", kwnames)) { + goto exit; + } return_value = os_putenv_impl(module, name, value); exit: @@ -4303,22 +4420,26 @@ PyDoc_STRVAR(os_putenv__doc__, "Change or add an environment variable."); #define OS_PUTENV_METHODDEF \ - {"putenv", (PyCFunction)os_putenv, METH_VARARGS, os_putenv__doc__}, + {"putenv", (PyCFunction)os_putenv, METH_FASTCALL, os_putenv__doc__}, static PyObject * os_putenv_impl(PyObject *module, PyObject *name, PyObject *value); static PyObject * -os_putenv(PyObject *module, PyObject *args) +os_putenv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *name = NULL; PyObject *value = NULL; - if (!PyArg_ParseTuple(args, "O&O&:putenv", + if (!_PyArg_ParseStack(args, nargs, "O&O&:putenv", PyUnicode_FSConverter, &name, PyUnicode_FSConverter, &value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("putenv", kwnames)) { + goto exit; + } return_value = os_putenv_impl(module, name, value); exit: @@ -4705,7 +4826,7 @@ exit: #endif /* defined(WSTOPSIG) */ -#if (defined(HAVE_FSTATVFS)) +#if defined(HAVE_FSTATVFS) PyDoc_STRVAR(os_fstatvfs__doc__, "fstatvfs($module, fd, /)\n" @@ -4736,9 +4857,9 @@ exit: return return_value; } -#endif /* (defined(HAVE_FSTATVFS)) */ +#endif /* defined(HAVE_FSTATVFS) */ -#if (defined(HAVE_STATVFS)) +#if defined(HAVE_STATVFS) PyDoc_STRVAR(os_statvfs__doc__, "statvfs($module, /, path)\n" @@ -4777,7 +4898,7 @@ exit: return return_value; } -#endif /* (defined(HAVE_STATVFS)) */ +#endif /* defined(HAVE_STATVFS) */ #if defined(MS_WINDOWS) @@ -4824,23 +4945,27 @@ PyDoc_STRVAR(os_fpathconf__doc__, "If there is no limit, return -1."); #define OS_FPATHCONF_METHODDEF \ - {"fpathconf", (PyCFunction)os_fpathconf, METH_VARARGS, os_fpathconf__doc__}, + {"fpathconf", (PyCFunction)os_fpathconf, METH_FASTCALL, os_fpathconf__doc__}, static long os_fpathconf_impl(PyObject *module, int fd, int name); static PyObject * -os_fpathconf(PyObject *module, PyObject *args) +os_fpathconf(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; int name; long _return_value; - if (!PyArg_ParseTuple(args, "iO&:fpathconf", + if (!_PyArg_ParseStack(args, nargs, "iO&:fpathconf", &fd, conv_path_confname, &name)) { goto exit; } + + if (!_PyArg_NoStackKeywords("fpathconf", kwnames)) { + goto exit; + } _return_value = os_fpathconf_impl(module, fd, name); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; @@ -5111,23 +5236,27 @@ PyDoc_STRVAR(os_setresuid__doc__, "Set the current process\'s real, effective, and saved user ids."); #define OS_SETRESUID_METHODDEF \ - {"setresuid", (PyCFunction)os_setresuid, METH_VARARGS, os_setresuid__doc__}, + {"setresuid", (PyCFunction)os_setresuid, METH_FASTCALL, os_setresuid__doc__}, static PyObject * os_setresuid_impl(PyObject *module, uid_t ruid, uid_t euid, uid_t suid); static PyObject * -os_setresuid(PyObject *module, PyObject *args) +os_setresuid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; uid_t ruid; uid_t euid; uid_t suid; - if (!PyArg_ParseTuple(args, "O&O&O&:setresuid", + if (!_PyArg_ParseStack(args, nargs, "O&O&O&:setresuid", _Py_Uid_Converter, &ruid, _Py_Uid_Converter, &euid, _Py_Uid_Converter, &suid)) { goto exit; } + + if (!_PyArg_NoStackKeywords("setresuid", kwnames)) { + goto exit; + } return_value = os_setresuid_impl(module, ruid, euid, suid); exit: @@ -5145,23 +5274,27 @@ PyDoc_STRVAR(os_setresgid__doc__, "Set the current process\'s real, effective, and saved group ids."); #define OS_SETRESGID_METHODDEF \ - {"setresgid", (PyCFunction)os_setresgid, METH_VARARGS, os_setresgid__doc__}, + {"setresgid", (PyCFunction)os_setresgid, METH_FASTCALL, os_setresgid__doc__}, static PyObject * os_setresgid_impl(PyObject *module, gid_t rgid, gid_t egid, gid_t sgid); static PyObject * -os_setresgid(PyObject *module, PyObject *args) +os_setresgid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; gid_t rgid; gid_t egid; gid_t sgid; - if (!PyArg_ParseTuple(args, "O&O&O&:setresgid", + if (!_PyArg_ParseStack(args, nargs, "O&O&O&:setresgid", _Py_Gid_Converter, &rgid, _Py_Gid_Converter, &egid, _Py_Gid_Converter, &sgid)) { goto exit; } + + if (!_PyArg_NoStackKeywords("setresgid", kwnames)) { + goto exit; + } return_value = os_setresgid_impl(module, rgid, egid, sgid); exit: @@ -5494,22 +5627,26 @@ PyDoc_STRVAR(os_set_inheritable__doc__, "Set the inheritable flag of the specified file descriptor."); #define OS_SET_INHERITABLE_METHODDEF \ - {"set_inheritable", (PyCFunction)os_set_inheritable, METH_VARARGS, os_set_inheritable__doc__}, + {"set_inheritable", (PyCFunction)os_set_inheritable, METH_FASTCALL, os_set_inheritable__doc__}, static PyObject * os_set_inheritable_impl(PyObject *module, int fd, int inheritable); static PyObject * -os_set_inheritable(PyObject *module, PyObject *args) +os_set_inheritable(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int fd; int inheritable; - if (!PyArg_ParseTuple(args, "ii:set_inheritable", + if (!_PyArg_ParseStack(args, nargs, "ii:set_inheritable", &fd, &inheritable)) { goto exit; } + + if (!_PyArg_NoStackKeywords("set_inheritable", kwnames)) { + goto exit; + } return_value = os_set_inheritable_impl(module, fd, inheritable); exit: @@ -5561,23 +5698,27 @@ PyDoc_STRVAR(os_set_handle_inheritable__doc__, "Set the inheritable flag of the specified handle."); #define OS_SET_HANDLE_INHERITABLE_METHODDEF \ - {"set_handle_inheritable", (PyCFunction)os_set_handle_inheritable, METH_VARARGS, os_set_handle_inheritable__doc__}, + {"set_handle_inheritable", (PyCFunction)os_set_handle_inheritable, METH_FASTCALL, os_set_handle_inheritable__doc__}, static PyObject * os_set_handle_inheritable_impl(PyObject *module, intptr_t handle, int inheritable); static PyObject * -os_set_handle_inheritable(PyObject *module, PyObject *args) +os_set_handle_inheritable(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; intptr_t handle; int inheritable; - if (!PyArg_ParseTuple(args, "" _Py_PARSE_INTPTR "p:set_handle_inheritable", + if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_INTPTR "p:set_handle_inheritable", &handle, &inheritable)) { goto exit; } + + if (!_PyArg_NoStackKeywords("set_handle_inheritable", kwnames)) { + goto exit; + } return_value = os_set_handle_inheritable_impl(module, handle, inheritable); exit: @@ -5719,18 +5860,10 @@ exit: #define OS__GETFULLPATHNAME_METHODDEF #endif /* !defined(OS__GETFULLPATHNAME_METHODDEF) */ -#ifndef OS__GETFINALPATHNAME_METHODDEF - #define OS__GETFINALPATHNAME_METHODDEF -#endif /* !defined(OS__GETFINALPATHNAME_METHODDEF) */ - #ifndef OS__ISDIR_METHODDEF #define OS__ISDIR_METHODDEF #endif /* !defined(OS__ISDIR_METHODDEF) */ -#ifndef OS__GETVOLUMEPATHNAME_METHODDEF - #define OS__GETVOLUMEPATHNAME_METHODDEF -#endif /* !defined(OS__GETVOLUMEPATHNAME_METHODDEF) */ - #ifndef OS_NICE_METHODDEF #define OS_NICE_METHODDEF #endif /* !defined(OS_NICE_METHODDEF) */ @@ -5803,10 +5936,6 @@ exit: #define OS_SCHED_RR_GET_INTERVAL_METHODDEF #endif /* !defined(OS_SCHED_RR_GET_INTERVAL_METHODDEF) */ -#ifndef OS_SCHED_YIELD_METHODDEF - #define OS_SCHED_YIELD_METHODDEF -#endif /* !defined(OS_SCHED_YIELD_METHODDEF) */ - #ifndef OS_SCHED_SETAFFINITY_METHODDEF #define OS_SCHED_SETAFFINITY_METHODDEF #endif /* !defined(OS_SCHED_SETAFFINITY_METHODDEF) */ @@ -6138,4 +6267,4 @@ exit: #ifndef OS_GETRANDOM_METHODDEF #define OS_GETRANDOM_METHODDEF #endif /* !defined(OS_GETRANDOM_METHODDEF) */ -/*[clinic end generated code: output=92026f29ec925950 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f222503f1d1fd002 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/pyexpat.inc b/third_party/python/Modules/clinic/pyexpat.inc index e03198e49..0cfeb624b 100644 --- a/third_party/python/Modules/clinic/pyexpat.inc +++ b/third_party/python/Modules/clinic/pyexpat.inc @@ -12,23 +12,27 @@ PyDoc_STRVAR(pyexpat_xmlparser_Parse__doc__, "`isfinal\' should be true at end of input."); #define PYEXPAT_XMLPARSER_PARSE_METHODDEF \ - {"Parse", (PyCFunction)pyexpat_xmlparser_Parse, METH_VARARGS, pyexpat_xmlparser_Parse__doc__}, + {"Parse", (PyCFunction)pyexpat_xmlparser_Parse, METH_FASTCALL, pyexpat_xmlparser_Parse__doc__}, static PyObject * pyexpat_xmlparser_Parse_impl(xmlparseobject *self, PyObject *data, int isfinal); static PyObject * -pyexpat_xmlparser_Parse(xmlparseobject *self, PyObject *args) +pyexpat_xmlparser_Parse(xmlparseobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *data; int isfinal = 0; - if (!PyArg_ParseTuple(args, "O|i:Parse", + if (!_PyArg_ParseStack(args, nargs, "O|i:Parse", &data, &isfinal)) { goto exit; } + + if (!_PyArg_NoStackKeywords("Parse", kwnames)) { + goto exit; + } return_value = pyexpat_xmlparser_Parse_impl(self, data, isfinal); exit: @@ -117,7 +121,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_ExternalEntityParserCreate__doc__, "Create a parser for parsing an external entity based on the information passed to the ExternalEntityRefHandler."); #define PYEXPAT_XMLPARSER_EXTERNALENTITYPARSERCREATE_METHODDEF \ - {"ExternalEntityParserCreate", (PyCFunction)pyexpat_xmlparser_ExternalEntityParserCreate, METH_VARARGS, pyexpat_xmlparser_ExternalEntityParserCreate__doc__}, + {"ExternalEntityParserCreate", (PyCFunction)pyexpat_xmlparser_ExternalEntityParserCreate, METH_FASTCALL, pyexpat_xmlparser_ExternalEntityParserCreate__doc__}, static PyObject * pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self, @@ -125,16 +129,20 @@ pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self, const char *encoding); static PyObject * -pyexpat_xmlparser_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args) +pyexpat_xmlparser_ExternalEntityParserCreate(xmlparseobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; const char *context; const char *encoding = NULL; - if (!PyArg_ParseTuple(args, "z|s:ExternalEntityParserCreate", + if (!_PyArg_ParseStack(args, nargs, "z|s:ExternalEntityParserCreate", &context, &encoding)) { goto exit; } + + if (!_PyArg_NoStackKeywords("ExternalEntityParserCreate", kwnames)) { + goto exit; + } return_value = pyexpat_xmlparser_ExternalEntityParserCreate_impl(self, context, encoding); exit: @@ -186,21 +194,25 @@ PyDoc_STRVAR(pyexpat_xmlparser_UseForeignDTD__doc__, "information to the parser. \'flag\' defaults to True if not provided."); #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF \ - {"UseForeignDTD", (PyCFunction)pyexpat_xmlparser_UseForeignDTD, METH_VARARGS, pyexpat_xmlparser_UseForeignDTD__doc__}, + {"UseForeignDTD", (PyCFunction)pyexpat_xmlparser_UseForeignDTD, METH_FASTCALL, pyexpat_xmlparser_UseForeignDTD__doc__}, static PyObject * pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, int flag); static PyObject * -pyexpat_xmlparser_UseForeignDTD(xmlparseobject *self, PyObject *args) +pyexpat_xmlparser_UseForeignDTD(xmlparseobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int flag = 1; - if (!PyArg_ParseTuple(args, "|p:UseForeignDTD", + if (!_PyArg_ParseStack(args, nargs, "|p:UseForeignDTD", &flag)) { goto exit; } + + if (!_PyArg_NoStackKeywords("UseForeignDTD", kwnames)) { + goto exit; + } return_value = pyexpat_xmlparser_UseForeignDTD_impl(self, flag); exit: @@ -290,4 +302,4 @@ exit: #ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */ -/*[clinic end generated code: output=e889f7c6af6cc42f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0548a6b12157e29b input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/signalmodule.inc b/third_party/python/Modules/clinic/signalmodule.inc index 507567dd9..3f09e022a 100644 --- a/third_party/python/Modules/clinic/signalmodule.inc +++ b/third_party/python/Modules/clinic/signalmodule.inc @@ -75,22 +75,26 @@ PyDoc_STRVAR(signal_signal__doc__, "the first is the signal number, the second is the interrupted stack frame."); #define SIGNAL_SIGNAL_METHODDEF \ - {"signal", (PyCFunction)signal_signal, METH_VARARGS, signal_signal__doc__}, + {"signal", (PyCFunction)signal_signal, METH_FASTCALL, signal_signal__doc__}, static PyObject * signal_signal_impl(PyObject *module, int signalnum, PyObject *handler); static PyObject * -signal_signal(PyObject *module, PyObject *args) +signal_signal(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int signalnum; PyObject *handler; - if (!PyArg_ParseTuple(args, "iO:signal", + if (!_PyArg_ParseStack(args, nargs, "iO:signal", &signalnum, &handler)) { goto exit; } + + if (!_PyArg_NoStackKeywords("signal", kwnames)) { + goto exit; + } return_value = signal_signal_impl(module, signalnum, handler); exit: @@ -142,22 +146,26 @@ PyDoc_STRVAR(signal_siginterrupt__doc__, "signal sig, else system calls will be interrupted."); #define SIGNAL_SIGINTERRUPT_METHODDEF \ - {"siginterrupt", (PyCFunction)signal_siginterrupt, METH_VARARGS, signal_siginterrupt__doc__}, + {"siginterrupt", (PyCFunction)signal_siginterrupt, METH_FASTCALL, signal_siginterrupt__doc__}, static PyObject * signal_siginterrupt_impl(PyObject *module, int signalnum, int flag); static PyObject * -signal_siginterrupt(PyObject *module, PyObject *args) +signal_siginterrupt(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int signalnum; int flag; - if (!PyArg_ParseTuple(args, "ii:siginterrupt", + if (!_PyArg_ParseStack(args, nargs, "ii:siginterrupt", &signalnum, &flag)) { goto exit; } + + if (!_PyArg_NoStackKeywords("siginterrupt", kwnames)) { + goto exit; + } return_value = signal_siginterrupt_impl(module, signalnum, flag); exit: @@ -180,24 +188,28 @@ PyDoc_STRVAR(signal_setitimer__doc__, "Returns old values as a tuple: (delay, interval)."); #define SIGNAL_SETITIMER_METHODDEF \ - {"setitimer", (PyCFunction)signal_setitimer, METH_VARARGS, signal_setitimer__doc__}, + {"setitimer", (PyCFunction)signal_setitimer, METH_FASTCALL, signal_setitimer__doc__}, static PyObject * signal_setitimer_impl(PyObject *module, int which, double seconds, double interval); static PyObject * -signal_setitimer(PyObject *module, PyObject *args) +signal_setitimer(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int which; double seconds; double interval = 0.0; - if (!PyArg_ParseTuple(args, "id|d:setitimer", + if (!_PyArg_ParseStack(args, nargs, "id|d:setitimer", &which, &seconds, &interval)) { goto exit; } + + if (!_PyArg_NoStackKeywords("setitimer", kwnames)) { + goto exit; + } return_value = signal_setitimer_impl(module, which, seconds, interval); exit: @@ -246,22 +258,26 @@ PyDoc_STRVAR(signal_pthread_sigmask__doc__, "Fetch and/or change the signal mask of the calling thread."); #define SIGNAL_PTHREAD_SIGMASK_METHODDEF \ - {"pthread_sigmask", (PyCFunction)signal_pthread_sigmask, METH_VARARGS, signal_pthread_sigmask__doc__}, + {"pthread_sigmask", (PyCFunction)signal_pthread_sigmask, METH_FASTCALL, signal_pthread_sigmask__doc__}, static PyObject * signal_pthread_sigmask_impl(PyObject *module, int how, PyObject *mask); static PyObject * -signal_pthread_sigmask(PyObject *module, PyObject *args) +signal_pthread_sigmask(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int how; PyObject *mask; - if (!PyArg_ParseTuple(args, "iO:pthread_sigmask", + if (!_PyArg_ParseStack(args, nargs, "iO:pthread_sigmask", &how, &mask)) { goto exit; } + + if (!_PyArg_NoStackKeywords("pthread_sigmask", kwnames)) { + goto exit; + } return_value = signal_pthread_sigmask_impl(module, how, mask); exit: @@ -373,22 +389,26 @@ PyDoc_STRVAR(signal_pthread_kill__doc__, "Send a signal to a thread."); #define SIGNAL_PTHREAD_KILL_METHODDEF \ - {"pthread_kill", (PyCFunction)signal_pthread_kill, METH_VARARGS, signal_pthread_kill__doc__}, + {"pthread_kill", (PyCFunction)signal_pthread_kill, METH_FASTCALL, signal_pthread_kill__doc__}, static PyObject * signal_pthread_kill_impl(PyObject *module, long thread_id, int signalnum); static PyObject * -signal_pthread_kill(PyObject *module, PyObject *args) +signal_pthread_kill(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; long thread_id; int signalnum; - if (!PyArg_ParseTuple(args, "li:pthread_kill", + if (!_PyArg_ParseStack(args, nargs, "li:pthread_kill", &thread_id, &signalnum)) { goto exit; } + + if (!_PyArg_NoStackKeywords("pthread_kill", kwnames)) { + goto exit; + } return_value = signal_pthread_kill_impl(module, thread_id, signalnum); exit: @@ -440,4 +460,4 @@ exit: #ifndef SIGNAL_PTHREAD_KILL_METHODDEF #define SIGNAL_PTHREAD_KILL_METHODDEF #endif /* !defined(SIGNAL_PTHREAD_KILL_METHODDEF) */ -/*[clinic end generated code: output=c6990ef0d0ba72b6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b49f7bfff44d1256 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/unicodedata.inc b/third_party/python/Modules/clinic/unicodedata.inc index 3ba4f988f..8f8d59777 100644 --- a/third_party/python/Modules/clinic/unicodedata.inc +++ b/third_party/python/Modules/clinic/unicodedata.inc @@ -14,23 +14,27 @@ PyDoc_STRVAR(unicodedata_UCD_decimal__doc__, "ValueError is raised."); #define UNICODEDATA_UCD_DECIMAL_METHODDEF \ - {"decimal", (PyCFunction)unicodedata_UCD_decimal, METH_VARARGS, unicodedata_UCD_decimal__doc__}, + {"decimal", (PyCFunction)unicodedata_UCD_decimal, METH_FASTCALL, unicodedata_UCD_decimal__doc__}, static PyObject * unicodedata_UCD_decimal_impl(PyObject *self, int chr, PyObject *default_value); static PyObject * -unicodedata_UCD_decimal(PyObject *self, PyObject *args) +unicodedata_UCD_decimal(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int chr; PyObject *default_value = NULL; - if (!PyArg_ParseTuple(args, "C|O:decimal", + if (!_PyArg_ParseStack(args, nargs, "C|O:decimal", &chr, &default_value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("decimal", kwnames)) { + goto exit; + } return_value = unicodedata_UCD_decimal_impl(self, chr, default_value); exit: @@ -48,22 +52,26 @@ PyDoc_STRVAR(unicodedata_UCD_digit__doc__, "ValueError is raised."); #define UNICODEDATA_UCD_DIGIT_METHODDEF \ - {"digit", (PyCFunction)unicodedata_UCD_digit, METH_VARARGS, unicodedata_UCD_digit__doc__}, + {"digit", (PyCFunction)unicodedata_UCD_digit, METH_FASTCALL, unicodedata_UCD_digit__doc__}, static PyObject * unicodedata_UCD_digit_impl(PyObject *self, int chr, PyObject *default_value); static PyObject * -unicodedata_UCD_digit(PyObject *self, PyObject *args) +unicodedata_UCD_digit(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int chr; PyObject *default_value = NULL; - if (!PyArg_ParseTuple(args, "C|O:digit", + if (!_PyArg_ParseStack(args, nargs, "C|O:digit", &chr, &default_value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("digit", kwnames)) { + goto exit; + } return_value = unicodedata_UCD_digit_impl(self, chr, default_value); exit: @@ -81,23 +89,27 @@ PyDoc_STRVAR(unicodedata_UCD_numeric__doc__, "ValueError is raised."); #define UNICODEDATA_UCD_NUMERIC_METHODDEF \ - {"numeric", (PyCFunction)unicodedata_UCD_numeric, METH_VARARGS, unicodedata_UCD_numeric__doc__}, + {"numeric", (PyCFunction)unicodedata_UCD_numeric, METH_FASTCALL, unicodedata_UCD_numeric__doc__}, static PyObject * unicodedata_UCD_numeric_impl(PyObject *self, int chr, PyObject *default_value); static PyObject * -unicodedata_UCD_numeric(PyObject *self, PyObject *args) +unicodedata_UCD_numeric(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int chr; PyObject *default_value = NULL; - if (!PyArg_ParseTuple(args, "C|O:numeric", + if (!_PyArg_ParseStack(args, nargs, "C|O:numeric", &chr, &default_value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("numeric", kwnames)) { + goto exit; + } return_value = unicodedata_UCD_numeric_impl(self, chr, default_value); exit: @@ -294,23 +306,27 @@ PyDoc_STRVAR(unicodedata_UCD_normalize__doc__, "Valid values for form are \'NFC\', \'NFKC\', \'NFD\', and \'NFKD\'."); #define UNICODEDATA_UCD_NORMALIZE_METHODDEF \ - {"normalize", (PyCFunction)unicodedata_UCD_normalize, METH_VARARGS, unicodedata_UCD_normalize__doc__}, + {"normalize", (PyCFunction)unicodedata_UCD_normalize, METH_FASTCALL, unicodedata_UCD_normalize__doc__}, static PyObject * unicodedata_UCD_normalize_impl(PyObject *self, const char *form, PyObject *input); static PyObject * -unicodedata_UCD_normalize(PyObject *self, PyObject *args) +unicodedata_UCD_normalize(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; const char *form; PyObject *input; - if (!PyArg_ParseTuple(args, "sO!:normalize", + if (!_PyArg_ParseStack(args, nargs, "sO!:normalize", &form, &PyUnicode_Type, &input)) { goto exit; } + + if (!_PyArg_NoStackKeywords("normalize", kwnames)) { + goto exit; + } return_value = unicodedata_UCD_normalize_impl(self, form, input); exit: @@ -327,22 +343,26 @@ PyDoc_STRVAR(unicodedata_UCD_name__doc__, "ValueError is raised."); #define UNICODEDATA_UCD_NAME_METHODDEF \ - {"name", (PyCFunction)unicodedata_UCD_name, METH_VARARGS, unicodedata_UCD_name__doc__}, + {"name", (PyCFunction)unicodedata_UCD_name, METH_FASTCALL, unicodedata_UCD_name__doc__}, static PyObject * unicodedata_UCD_name_impl(PyObject *self, int chr, PyObject *default_value); static PyObject * -unicodedata_UCD_name(PyObject *self, PyObject *args) +unicodedata_UCD_name(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int chr; PyObject *default_value = NULL; - if (!PyArg_ParseTuple(args, "C|O:name", + if (!_PyArg_ParseStack(args, nargs, "C|O:name", &chr, &default_value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("name", kwnames)) { + goto exit; + } return_value = unicodedata_UCD_name_impl(self, chr, default_value); exit: @@ -380,4 +400,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=5313ce129da87b2f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=badeb811d1caec40 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/clinic/zlibmodule.inc b/third_party/python/Modules/clinic/zlibmodule.inc index c590f8677..c781f4c47 100644 --- a/third_party/python/Modules/clinic/zlibmodule.inc +++ b/third_party/python/Modules/clinic/zlibmodule.inc @@ -17,6 +17,9 @@ PyDoc_STRVAR(zlib_compress__doc__, #define ZLIB_COMPRESS_METHODDEF \ {"compress", (PyCFunction)zlib_compress, METH_FASTCALL, zlib_compress__doc__}, +static PyObject * +zlib_compress_impl(PyObject *module, Py_buffer *data, int level); + static PyObject * zlib_compress(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { @@ -110,7 +113,7 @@ PyDoc_STRVAR(zlib_compressobj__doc__, " Valid values range from 1 to 9. Higher values result in higher memory\n" " usage, faster compression, and smaller output.\n" " strategy\n" -" Used to tune the compression algorithm. Possible values are\n" +" Used to tune the compression algorithm. Possible values are\n" " Z_DEFAULT_STRATEGY, Z_RLE, Z_HUFFMAN_ONLY, Z_FILTERED, and\n" " Z_FIXED.\n" " zdict\n" @@ -289,21 +292,25 @@ PyDoc_STRVAR(zlib_Compress_flush__doc__, " can still be compressed."); #define ZLIB_COMPRESS_FLUSH_METHODDEF \ - {"flush", (PyCFunction)zlib_Compress_flush, METH_VARARGS, zlib_Compress_flush__doc__}, + {"flush", (PyCFunction)zlib_Compress_flush, METH_FASTCALL, zlib_Compress_flush__doc__}, static PyObject * zlib_Compress_flush_impl(compobject *self, int mode); static PyObject * -zlib_Compress_flush(compobject *self, PyObject *args) +zlib_Compress_flush(compobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int mode = Z_FINISH; - if (!PyArg_ParseTuple(args, "|i:flush", + if (!_PyArg_ParseStack(args, nargs, "|i:flush", &mode)) { goto exit; } + + if (!_PyArg_NoStackKeywords("flush", kwnames)) { + goto exit; + } return_value = zlib_Compress_flush_impl(self, mode); exit: @@ -364,21 +371,25 @@ PyDoc_STRVAR(zlib_Decompress_flush__doc__, " the initial size of the output buffer."); #define ZLIB_DECOMPRESS_FLUSH_METHODDEF \ - {"flush", (PyCFunction)zlib_Decompress_flush, METH_VARARGS, zlib_Decompress_flush__doc__}, + {"flush", (PyCFunction)zlib_Decompress_flush, METH_FASTCALL, zlib_Decompress_flush__doc__}, static PyObject * zlib_Decompress_flush_impl(compobject *self, Py_ssize_t length); static PyObject * -zlib_Decompress_flush(compobject *self, PyObject *args) +zlib_Decompress_flush(compobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t length = DEF_BUF_SIZE; - if (!PyArg_ParseTuple(args, "|O&:flush", + if (!_PyArg_ParseStack(args, nargs, "|O&:flush", ssize_t_converter, &length)) { goto exit; } + + if (!_PyArg_NoStackKeywords("flush", kwnames)) { + goto exit; + } return_value = zlib_Decompress_flush_impl(self, length); exit: @@ -397,22 +408,26 @@ PyDoc_STRVAR(zlib_adler32__doc__, "The returned checksum is an integer."); #define ZLIB_ADLER32_METHODDEF \ - {"adler32", (PyCFunction)zlib_adler32, METH_VARARGS, zlib_adler32__doc__}, + {"adler32", (PyCFunction)zlib_adler32, METH_FASTCALL, zlib_adler32__doc__}, static PyObject * zlib_adler32_impl(PyObject *module, Py_buffer *data, unsigned int value); static PyObject * -zlib_adler32(PyObject *module, PyObject *args) +zlib_adler32(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; unsigned int value = 1; - if (!PyArg_ParseTuple(args, "y*|I:adler32", + if (!_PyArg_ParseStack(args, nargs, "y*|I:adler32", &data, &value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("adler32", kwnames)) { + goto exit; + } return_value = zlib_adler32_impl(module, &data, value); exit: @@ -436,22 +451,26 @@ PyDoc_STRVAR(zlib_crc32__doc__, "The returned checksum is an integer."); #define ZLIB_CRC32_METHODDEF \ - {"crc32", (PyCFunction)zlib_crc32, METH_VARARGS, zlib_crc32__doc__}, + {"crc32", (PyCFunction)zlib_crc32, METH_FASTCALL, zlib_crc32__doc__}, static PyObject * zlib_crc32_impl(PyObject *module, Py_buffer *data, unsigned int value); static PyObject * -zlib_crc32(PyObject *module, PyObject *args) +zlib_crc32(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; unsigned int value = 0; - if (!PyArg_ParseTuple(args, "y*|I:crc32", + if (!_PyArg_ParseStack(args, nargs, "y*|I:crc32", &data, &value)) { goto exit; } + + if (!_PyArg_NoStackKeywords("crc32", kwnames)) { + goto exit; + } return_value = zlib_crc32_impl(module, &data, value); exit: @@ -466,8 +485,4 @@ exit: #ifndef ZLIB_COMPRESS_COPY_METHODDEF #define ZLIB_COMPRESS_COPY_METHODDEF #endif /* !defined(ZLIB_COMPRESS_COPY_METHODDEF) */ - -#ifndef ZLIB_DECOMPRESS_COPY_METHODDEF - #define ZLIB_DECOMPRESS_COPY_METHODDEF -#endif /* !defined(ZLIB_DECOMPRESS_COPY_METHODDEF) */ -/*[clinic end generated code: output=497dad1132c962e2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c6cb10ed66f226b2 input=a9049054013a1b77]*/ diff --git a/third_party/python/Modules/zlibmodule.c b/third_party/python/Modules/zlibmodule.c index 02657b2af..e63ef66dc 100644 --- a/third_party/python/Modules/zlibmodule.c +++ b/third_party/python/Modules/zlibmodule.c @@ -503,7 +503,7 @@ Return a compressor object. static PyObject * zlib_compressobj_impl(PyObject *module, int level, int method, int wbits, int memLevel, int strategy, Py_buffer *zdict) -/*[clinic end generated code: output=8b5bed9c8fc3814d input=2fa3d026f90ab8d5]*/ +/*[clinic end generated code: output=8b5bed9c8fc3814d input=b5a08c304c3bae52]*/ { compobject *self = NULL; int err; diff --git a/third_party/python/Objects/clinic/bytearrayobject.inc b/third_party/python/Objects/clinic/bytearrayobject.inc index 9c60024d2..6e5d88b9a 100644 --- a/third_party/python/Objects/clinic/bytearrayobject.inc +++ b/third_party/python/Objects/clinic/bytearrayobject.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]*/ @@ -96,22 +89,26 @@ PyDoc_STRVAR(bytearray_maketrans__doc__, "The bytes objects frm and to must be of the same length."); #define BYTEARRAY_MAKETRANS_METHODDEF \ - {"maketrans", (PyCFunction)bytearray_maketrans, METH_VARARGS|METH_STATIC, bytearray_maketrans__doc__}, + {"maketrans", (PyCFunction)bytearray_maketrans, METH_FASTCALL|METH_STATIC, bytearray_maketrans__doc__}, static PyObject * bytearray_maketrans_impl(Py_buffer *frm, Py_buffer *to); static PyObject * -bytearray_maketrans(void *null, PyObject *args) +bytearray_maketrans(void *null, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer frm = {NULL, NULL}; Py_buffer to = {NULL, NULL}; - if (!PyArg_ParseTuple(args, "y*y*:maketrans", + if (!_PyArg_ParseStack(args, nargs, "y*y*:maketrans", &frm, &to)) { goto exit; } + + if (!_PyArg_NoStackKeywords("maketrans", kwnames)) { + goto exit; + } return_value = bytearray_maketrans_impl(&frm, &to); exit: @@ -141,24 +138,28 @@ PyDoc_STRVAR(bytearray_replace__doc__, "replaced."); #define BYTEARRAY_REPLACE_METHODDEF \ - {"replace", (PyCFunction)bytearray_replace, METH_VARARGS, bytearray_replace__doc__}, + {"replace", (PyCFunction)bytearray_replace, METH_FASTCALL, bytearray_replace__doc__}, static PyObject * bytearray_replace_impl(PyByteArrayObject *self, Py_buffer *old, Py_buffer *new, Py_ssize_t count); static PyObject * -bytearray_replace(PyByteArrayObject *self, PyObject *args) +bytearray_replace(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer old = {NULL, NULL}; Py_buffer new = {NULL, NULL}; Py_ssize_t count = -1; - if (!PyArg_ParseTuple(args, "y*y*|n:replace", + if (!_PyArg_ParseStack(args, nargs, "y*y*|n:replace", &old, &new, &count)) { goto exit; } + + if (!_PyArg_NoStackKeywords("replace", kwnames)) { + goto exit; + } return_value = bytearray_replace_impl(self, &old, &new, count); exit: @@ -222,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 as new bytearray objects.\n" +"separator itself, and the part after it.\n" "\n" -"If the separator is not found, returns a 3-tuple containing the copy of the\n" -"original bytearray object and two empty bytearray objects."); +"If the separator is not found, returns a 3-tuple containing the original\n" +"bytearray object and two empty bytearray objects."); #define BYTEARRAY_PARTITION_METHODDEF \ {"partition", (PyCFunction)bytearray_partition, METH_O, bytearray_partition__doc__}, @@ -234,15 +235,14 @@ PyDoc_STRVAR(bytearray_rpartition__doc__, "rpartition($self, sep, /)\n" "--\n" "\n" -"Partition the bytearray into three parts using the given separator.\n" +"Partition the bytes into three parts using the given separator.\n" "\n" -"This will search for the separator sep in the bytearray, starting at the end.\n" +"This will search for the separator sep in the bytearray, starting and 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 as new bytearray\n" -"objects.\n" +"separator, the separator itself, and the part after it.\n" "\n" "If the separator is not found, returns a 3-tuple containing two empty bytearray\n" -"objects and the copy of the original bytearray object."); +"objects and the original bytearray object."); #define BYTEARRAY_RPARTITION_METHODDEF \ {"rpartition", (PyCFunction)bytearray_rpartition, METH_O, bytearray_rpartition__doc__}, @@ -319,22 +319,26 @@ PyDoc_STRVAR(bytearray_insert__doc__, " The item to be inserted."); #define BYTEARRAY_INSERT_METHODDEF \ - {"insert", (PyCFunction)bytearray_insert, METH_VARARGS, bytearray_insert__doc__}, + {"insert", (PyCFunction)bytearray_insert, METH_FASTCALL, bytearray_insert__doc__}, static PyObject * bytearray_insert_impl(PyByteArrayObject *self, Py_ssize_t index, int item); static PyObject * -bytearray_insert(PyByteArrayObject *self, PyObject *args) +bytearray_insert(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t index; int item; - if (!PyArg_ParseTuple(args, "nO&:insert", + if (!_PyArg_ParseStack(args, nargs, "nO&:insert", &index, _getbytevalue, &item)) { goto exit; } + + if (!_PyArg_NoStackKeywords("insert", kwnames)) { + goto exit; + } return_value = bytearray_insert_impl(self, index, item); exit: @@ -396,21 +400,25 @@ PyDoc_STRVAR(bytearray_pop__doc__, "If no index argument is given, will pop the last item."); #define BYTEARRAY_POP_METHODDEF \ - {"pop", (PyCFunction)bytearray_pop, METH_VARARGS, bytearray_pop__doc__}, + {"pop", (PyCFunction)bytearray_pop, METH_FASTCALL, bytearray_pop__doc__}, static PyObject * bytearray_pop_impl(PyByteArrayObject *self, Py_ssize_t index); static PyObject * -bytearray_pop(PyByteArrayObject *self, PyObject *args) +bytearray_pop(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_ssize_t index = -1; - if (!PyArg_ParseTuple(args, "|n:pop", + if (!_PyArg_ParseStack(args, nargs, "|n:pop", &index)) { goto exit; } + + if (!_PyArg_NoStackKeywords("pop", kwnames)) { + goto exit; + } return_value = bytearray_pop_impl(self, index); exit: @@ -682,21 +690,25 @@ PyDoc_STRVAR(bytearray_reduce_ex__doc__, "Return state information for pickling."); #define BYTEARRAY_REDUCE_EX_METHODDEF \ - {"__reduce_ex__", (PyCFunction)bytearray_reduce_ex, METH_VARARGS, bytearray_reduce_ex__doc__}, + {"__reduce_ex__", (PyCFunction)bytearray_reduce_ex, METH_FASTCALL, bytearray_reduce_ex__doc__}, static PyObject * bytearray_reduce_ex_impl(PyByteArrayObject *self, int proto); static PyObject * -bytearray_reduce_ex(PyByteArrayObject *self, PyObject *args) +bytearray_reduce_ex(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int proto = 0; - if (!PyArg_ParseTuple(args, "|i:__reduce_ex__", + if (!_PyArg_ParseStack(args, nargs, "|i:__reduce_ex__", &proto)) { goto exit; } + + if (!_PyArg_NoStackKeywords("__reduce_ex__", kwnames)) { + goto exit; + } return_value = bytearray_reduce_ex_impl(self, proto); exit: @@ -720,4 +732,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored)) { return bytearray_sizeof_impl(self); } -/*[clinic end generated code: output=8f022100f059226c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e6c057d1cd7c2496 input=a9049054013a1b77]*/ diff --git a/third_party/python/Objects/clinic/bytesobject.inc b/third_party/python/Objects/clinic/bytesobject.inc index 826ab922c..56e98dc31 100644 --- a/third_party/python/Objects/clinic/bytesobject.inc +++ b/third_party/python/Objects/clinic/bytesobject.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]*/ @@ -94,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 at the end. If\n" +"This will search for the separator sep in the bytes, starting and 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" @@ -326,22 +319,26 @@ PyDoc_STRVAR(bytes_maketrans__doc__, "The bytes objects frm and to must be of the same length."); #define BYTES_MAKETRANS_METHODDEF \ - {"maketrans", (PyCFunction)bytes_maketrans, METH_VARARGS|METH_STATIC, bytes_maketrans__doc__}, + {"maketrans", (PyCFunction)bytes_maketrans, METH_FASTCALL|METH_STATIC, bytes_maketrans__doc__}, static PyObject * bytes_maketrans_impl(Py_buffer *frm, Py_buffer *to); static PyObject * -bytes_maketrans(void *null, PyObject *args) +bytes_maketrans(void *null, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer frm = {NULL, NULL}; Py_buffer to = {NULL, NULL}; - if (!PyArg_ParseTuple(args, "y*y*:maketrans", + if (!_PyArg_ParseStack(args, nargs, "y*y*:maketrans", &frm, &to)) { goto exit; } + + if (!_PyArg_NoStackKeywords("maketrans", kwnames)) { + goto exit; + } return_value = bytes_maketrans_impl(&frm, &to); exit: @@ -371,24 +368,28 @@ PyDoc_STRVAR(bytes_replace__doc__, "replaced."); #define BYTES_REPLACE_METHODDEF \ - {"replace", (PyCFunction)bytes_replace, METH_VARARGS, bytes_replace__doc__}, + {"replace", (PyCFunction)bytes_replace, METH_FASTCALL, bytes_replace__doc__}, static PyObject * bytes_replace_impl(PyBytesObject *self, Py_buffer *old, Py_buffer *new, Py_ssize_t count); static PyObject * -bytes_replace(PyBytesObject *self, PyObject *args) +bytes_replace(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; Py_buffer old = {NULL, NULL}; Py_buffer new = {NULL, NULL}; Py_ssize_t count = -1; - if (!PyArg_ParseTuple(args, "y*y*|n:replace", + if (!_PyArg_ParseStack(args, nargs, "y*y*|n:replace", &old, &new, &count)) { goto exit; } + + if (!_PyArg_NoStackKeywords("replace", kwnames)) { + goto exit; + } return_value = bytes_replace_impl(self, &old, &new, count); exit: @@ -507,4 +508,4 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=4ac7e35150d47467 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2b8d3cff7e11045e input=a9049054013a1b77]*/ diff --git a/third_party/python/Objects/clinic/dictobject.inc b/third_party/python/Objects/clinic/dictobject.inc index 5dfd38329..57932e69a 100644 --- a/third_party/python/Objects/clinic/dictobject.inc +++ b/third_party/python/Objects/clinic/dictobject.inc @@ -1,49 +1,44 @@ -/*-*- 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]*/ -PyDoc_STRVAR( - dict_fromkeys__doc__, - "fromkeys($type, iterable, value=None, /)\n" - "--\n" - "\n" - "Returns a new dict with keys from iterable and values equal to value."); +PyDoc_STRVAR(dict_fromkeys__doc__, +"fromkeys($type, iterable, value=None, /)\n" +"--\n" +"\n" +"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__}, +#define DICT_FROMKEYS_METHODDEF \ + {"fromkeys", (PyCFunction)dict_fromkeys, METH_VARARGS|METH_CLASS, dict_fromkeys__doc__}, -static PyObject *dict_fromkeys_impl(PyTypeObject *type, PyObject *iterable, - PyObject *value); +static PyObject * +dict_fromkeys_impl(PyTypeObject *type, PyObject *iterable, PyObject *value); -static PyObject *dict_fromkeys(PyTypeObject *type, PyObject *args) { - PyObject *return_value = NULL; - PyObject *iterable; - PyObject *value = Py_None; +static PyObject * +dict_fromkeys(PyTypeObject *type, PyObject *args) +{ + PyObject *return_value = NULL; + PyObject *iterable; + PyObject *value = Py_None; - if (!PyArg_UnpackTuple(args, "fromkeys", 1, 2, &iterable, &value)) { - goto exit; - } - return_value = dict_fromkeys_impl(type, iterable, value); + if (!PyArg_UnpackTuple(args, "fromkeys", + 1, 2, + &iterable, &value)) { + goto exit; + } + return_value = dict_fromkeys_impl(type, iterable, value); exit: - return return_value; + return return_value; } -PyDoc_STRVAR(dict___contains____doc__, "__contains__($self, key, /)\n" - "--\n" - "\n" - "True if D has a key k, else False."); +PyDoc_STRVAR(dict___contains____doc__, +"__contains__($self, key, /)\n" +"--\n" +"\n" +"True if D has a key k, else False."); -#define DICT___CONTAINS___METHODDEF \ - {"__contains__", (PyCFunction)dict___contains__, METH_O | METH_COEXIST, \ - 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]*/ diff --git a/third_party/python/Python/clinic/bltinmodule.inc b/third_party/python/Python/clinic/bltinmodule.inc index bb5f9ad29..a5fbc7ed2 100644 --- a/third_party/python/Python/clinic/bltinmodule.inc +++ b/third_party/python/Python/clinic/bltinmodule.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]*/ @@ -90,22 +83,26 @@ PyDoc_STRVAR(builtin_format__doc__, "details."); #define BUILTIN_FORMAT_METHODDEF \ - {"format", (PyCFunction)builtin_format, METH_VARARGS, builtin_format__doc__}, + {"format", (PyCFunction)builtin_format, METH_FASTCALL, builtin_format__doc__}, static PyObject * builtin_format_impl(PyObject *module, PyObject *value, PyObject *format_spec); static PyObject * -builtin_format(PyObject *module, PyObject *args) +builtin_format(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; PyObject *value; PyObject *format_spec = NULL; - if (!PyArg_ParseTuple(args, "O|U:format", + if (!_PyArg_ParseStack(args, nargs, "O|U:format", &value, &format_spec)) { goto exit; } + + if (!_PyArg_NoStackKeywords("format", kwnames)) { + goto exit; + } return_value = builtin_format_impl(module, value, format_spec); exit: @@ -127,9 +124,16 @@ builtin_chr_impl(PyObject *module, int i); static PyObject * builtin_chr(PyObject *module, PyObject *arg) { + PyObject *return_value = NULL; int i; - if (!PyArg_Parse(arg, "i:chr", &i)) return 0; - return builtin_chr_impl(module, i); + + if (!PyArg_Parse(arg, "i:chr", &i)) { + goto exit; + } + return_value = builtin_chr_impl(module, i); + +exit: + return return_value; } PyDoc_STRVAR(builtin_compile__doc__, @@ -677,4 +681,4 @@ builtin_issubclass(PyObject *module, PyObject *args) exit: return return_value; } -/*[clinic end generated code: output=2ef82846acdfa0f5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c0201eb152977af0 input=a9049054013a1b77]*/ diff --git a/third_party/python/Python/clinic/import.inc b/third_party/python/Python/clinic/import.inc index 2087ab4fb..714477903 100644 --- a/third_party/python/Python/clinic/import.inc +++ b/third_party/python/Python/clinic/import.inc @@ -1,348 +1,369 @@ -/*-*- 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 │ -╚─────────────────────────────────────────────────────────────────────────────*/ -#include "third_party/python/Include/pymacro.h" - +/* clang-format off */ /*[clinic input] preserve [clinic start generated code]*/ PyDoc_STRVAR(_imp_lock_held__doc__, - "lock_held($module, /)\n" - "--\n" - "\n" - "Return True if the import lock is currently held, else False.\n" - "\n" - "On platforms without threads, return False."); +"lock_held($module, /)\n" +"--\n" +"\n" +"Return True if the import lock is currently held, else False.\n" +"\n" +"On platforms without threads, return False."); -#define _IMP_LOCK_HELD_METHODDEF \ - {"lock_held", (PyCFunction)_imp_lock_held, METH_NOARGS, \ - _imp_lock_held__doc__}, +#define _IMP_LOCK_HELD_METHODDEF \ + {"lock_held", (PyCFunction)_imp_lock_held, METH_NOARGS, _imp_lock_held__doc__}, -static PyObject *_imp_lock_held_impl(PyObject *module); +static PyObject * +_imp_lock_held_impl(PyObject *module); -static PyObject *_imp_lock_held(PyObject *module, - PyObject *Py_UNUSED(ignored)) { - return _imp_lock_held_impl(module); +static PyObject * +_imp_lock_held(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return _imp_lock_held_impl(module); } -PyDoc_STRVAR( - _imp_acquire_lock__doc__, - "acquire_lock($module, /)\n" - "--\n" - "\n" - "Acquires the interpreter\'s import lock for the current thread.\n" - "\n" - "This lock should be used by import hooks to ensure thread-safety when " - "importing\n" - "modules. On platforms without threads, this function does nothing."); +PyDoc_STRVAR(_imp_acquire_lock__doc__, +"acquire_lock($module, /)\n" +"--\n" +"\n" +"Acquires the interpreter\'s import lock for the current thread.\n" +"\n" +"This lock should be used by import hooks to ensure thread-safety when importing\n" +"modules. On platforms without threads, this function does nothing."); -#define _IMP_ACQUIRE_LOCK_METHODDEF \ - {"acquire_lock", (PyCFunction)_imp_acquire_lock, METH_NOARGS, \ - _imp_acquire_lock__doc__}, +#define _IMP_ACQUIRE_LOCK_METHODDEF \ + {"acquire_lock", (PyCFunction)_imp_acquire_lock, METH_NOARGS, _imp_acquire_lock__doc__}, -static PyObject *_imp_acquire_lock_impl(PyObject *module); +static PyObject * +_imp_acquire_lock_impl(PyObject *module); -static PyObject *_imp_acquire_lock(PyObject *module, - PyObject *Py_UNUSED(ignored)) { - return _imp_acquire_lock_impl(module); +static PyObject * +_imp_acquire_lock(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return _imp_acquire_lock_impl(module); } PyDoc_STRVAR(_imp_release_lock__doc__, - "release_lock($module, /)\n" - "--\n" - "\n" - "Release the interpreter\'s import lock.\n" - "\n" - "On platforms without threads, this function does nothing."); +"release_lock($module, /)\n" +"--\n" +"\n" +"Release the interpreter\'s import lock.\n" +"\n" +"On platforms without threads, this function does nothing."); -#define _IMP_RELEASE_LOCK_METHODDEF \ - {"release_lock", (PyCFunction)_imp_release_lock, METH_NOARGS, \ - _imp_release_lock__doc__}, +#define _IMP_RELEASE_LOCK_METHODDEF \ + {"release_lock", (PyCFunction)_imp_release_lock, METH_NOARGS, _imp_release_lock__doc__}, -static PyObject *_imp_release_lock_impl(PyObject *module); +static PyObject * +_imp_release_lock_impl(PyObject *module); -static PyObject *_imp_release_lock(PyObject *module, - PyObject *Py_UNUSED(ignored)) { - return _imp_release_lock_impl(module); +static PyObject * +_imp_release_lock(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return _imp_release_lock_impl(module); } PyDoc_STRVAR(_imp__fix_co_filename__doc__, - "_fix_co_filename($module, code, path, /)\n" - "--\n" - "\n" - "Changes code.co_filename to specify the passed-in file path.\n" - "\n" - " code\n" - " Code object to change.\n" - " path\n" - " File path to use."); +"_fix_co_filename($module, code, path, /)\n" +"--\n" +"\n" +"Changes code.co_filename to specify the passed-in file path.\n" +"\n" +" code\n" +" Code object to change.\n" +" path\n" +" File path to use."); -#define _IMP__FIX_CO_FILENAME_METHODDEF \ - {"_fix_co_filename", (PyCFunction)_imp__fix_co_filename, METH_VARARGS, \ - _imp__fix_co_filename__doc__}, +#define _IMP__FIX_CO_FILENAME_METHODDEF \ + {"_fix_co_filename", (PyCFunction)_imp__fix_co_filename, METH_FASTCALL, _imp__fix_co_filename__doc__}, -static PyObject *_imp__fix_co_filename_impl(PyObject *module, - PyCodeObject *code, PyObject *path); +static PyObject * +_imp__fix_co_filename_impl(PyObject *module, PyCodeObject *code, + PyObject *path); -static PyObject *_imp__fix_co_filename(PyObject *module, PyObject *args) { - PyObject *return_value = NULL; - PyCodeObject *code; - PyObject *path; +static PyObject * +_imp__fix_co_filename(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + PyCodeObject *code; + PyObject *path; - if (!PyArg_ParseTuple(args, "O!U:_fix_co_filename", &PyCode_Type, &code, - &path)) { - goto exit; - } - return_value = _imp__fix_co_filename_impl(module, code, path); + if (!_PyArg_ParseStack(args, nargs, "O!U:_fix_co_filename", + &PyCode_Type, &code, &path)) { + goto exit; + } + + if (!_PyArg_NoStackKeywords("_fix_co_filename", kwnames)) { + goto exit; + } + return_value = _imp__fix_co_filename_impl(module, code, path); exit: - return return_value; + return return_value; } -PyDoc_STRVAR(_imp_create_builtin__doc__, "create_builtin($module, spec, /)\n" - "--\n" - "\n" - "Create an extension module."); +PyDoc_STRVAR(_imp_create_builtin__doc__, +"create_builtin($module, spec, /)\n" +"--\n" +"\n" +"Create an extension module."); -#define _IMP_CREATE_BUILTIN_METHODDEF \ - {"create_builtin", (PyCFunction)_imp_create_builtin, METH_O, \ - _imp_create_builtin__doc__}, +#define _IMP_CREATE_BUILTIN_METHODDEF \ + {"create_builtin", (PyCFunction)_imp_create_builtin, METH_O, _imp_create_builtin__doc__}, -PyDoc_STRVAR( - _imp_extension_suffixes__doc__, - "extension_suffixes($module, /)\n" - "--\n" - "\n" - "Returns the list of file suffixes used to identify extension modules."); +PyDoc_STRVAR(_imp_extension_suffixes__doc__, +"extension_suffixes($module, /)\n" +"--\n" +"\n" +"Returns the list of file suffixes used to identify extension modules."); -#define _IMP_EXTENSION_SUFFIXES_METHODDEF \ - {"extension_suffixes", (PyCFunction)_imp_extension_suffixes, METH_NOARGS, \ - _imp_extension_suffixes__doc__}, +#define _IMP_EXTENSION_SUFFIXES_METHODDEF \ + {"extension_suffixes", (PyCFunction)_imp_extension_suffixes, METH_NOARGS, _imp_extension_suffixes__doc__}, -static PyObject *_imp_extension_suffixes_impl(PyObject *module); +static PyObject * +_imp_extension_suffixes_impl(PyObject *module); -static PyObject *_imp_extension_suffixes(PyObject *module, - PyObject *Py_UNUSED(ignored)) { - return _imp_extension_suffixes_impl(module); +static PyObject * +_imp_extension_suffixes(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return _imp_extension_suffixes_impl(module); } -PyDoc_STRVAR(_imp_init_frozen__doc__, "init_frozen($module, name, /)\n" - "--\n" - "\n" - "Initializes a frozen module."); +PyDoc_STRVAR(_imp_init_frozen__doc__, +"init_frozen($module, name, /)\n" +"--\n" +"\n" +"Initializes a frozen module."); -#define _IMP_INIT_FROZEN_METHODDEF \ - {"init_frozen", (PyCFunction)_imp_init_frozen, METH_O, \ - _imp_init_frozen__doc__}, +#define _IMP_INIT_FROZEN_METHODDEF \ + {"init_frozen", (PyCFunction)_imp_init_frozen, METH_O, _imp_init_frozen__doc__}, -static PyObject *_imp_init_frozen_impl(PyObject *module, PyObject *name); +static PyObject * +_imp_init_frozen_impl(PyObject *module, PyObject *name); -static PyObject *_imp_init_frozen(PyObject *module, PyObject *arg) { - PyObject *return_value = NULL; - PyObject *name; +static PyObject * +_imp_init_frozen(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *name; - if (!PyArg_Parse(arg, "U:init_frozen", &name)) { - goto exit; - } - return_value = _imp_init_frozen_impl(module, name); + if (!PyArg_Parse(arg, "U:init_frozen", &name)) { + goto exit; + } + return_value = _imp_init_frozen_impl(module, name); exit: - return return_value; + return return_value; } PyDoc_STRVAR(_imp_get_frozen_object__doc__, - "get_frozen_object($module, name, /)\n" - "--\n" - "\n" - "Create a code object for a frozen module."); +"get_frozen_object($module, name, /)\n" +"--\n" +"\n" +"Create a code object for a frozen module."); -#define _IMP_GET_FROZEN_OBJECT_METHODDEF \ - {"get_frozen_object", (PyCFunction)_imp_get_frozen_object, METH_O, \ - _imp_get_frozen_object__doc__}, +#define _IMP_GET_FROZEN_OBJECT_METHODDEF \ + {"get_frozen_object", (PyCFunction)_imp_get_frozen_object, METH_O, _imp_get_frozen_object__doc__}, -static PyObject *_imp_get_frozen_object_impl(PyObject *module, PyObject *name); +static PyObject * +_imp_get_frozen_object_impl(PyObject *module, PyObject *name); -static PyObject *_imp_get_frozen_object(PyObject *module, PyObject *arg) { - PyObject *return_value = NULL; - PyObject *name; +static PyObject * +_imp_get_frozen_object(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *name; - if (!PyArg_Parse(arg, "U:get_frozen_object", &name)) { - goto exit; - } - return_value = _imp_get_frozen_object_impl(module, name); + if (!PyArg_Parse(arg, "U:get_frozen_object", &name)) { + goto exit; + } + return_value = _imp_get_frozen_object_impl(module, name); exit: - return return_value; + return return_value; } PyDoc_STRVAR(_imp_is_frozen_package__doc__, - "is_frozen_package($module, name, /)\n" - "--\n" - "\n" - "Returns True if the module name is of a frozen package."); +"is_frozen_package($module, name, /)\n" +"--\n" +"\n" +"Returns True if the module name is of a frozen package."); -#define _IMP_IS_FROZEN_PACKAGE_METHODDEF \ - {"is_frozen_package", (PyCFunction)_imp_is_frozen_package, METH_O, \ - _imp_is_frozen_package__doc__}, +#define _IMP_IS_FROZEN_PACKAGE_METHODDEF \ + {"is_frozen_package", (PyCFunction)_imp_is_frozen_package, METH_O, _imp_is_frozen_package__doc__}, -static PyObject *_imp_is_frozen_package_impl(PyObject *module, PyObject *name); +static PyObject * +_imp_is_frozen_package_impl(PyObject *module, PyObject *name); -static PyObject *_imp_is_frozen_package(PyObject *module, PyObject *arg) { - PyObject *return_value = NULL; - PyObject *name; +static PyObject * +_imp_is_frozen_package(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *name; - if (!PyArg_Parse(arg, "U:is_frozen_package", &name)) { - goto exit; - } - return_value = _imp_is_frozen_package_impl(module, name); + if (!PyArg_Parse(arg, "U:is_frozen_package", &name)) { + goto exit; + } + return_value = _imp_is_frozen_package_impl(module, name); exit: - return return_value; + return return_value; } -PyDoc_STRVAR( - _imp_is_builtin__doc__, - "is_builtin($module, name, /)\n" - "--\n" - "\n" - "Returns True if the module name corresponds to a built-in module."); +PyDoc_STRVAR(_imp_is_builtin__doc__, +"is_builtin($module, name, /)\n" +"--\n" +"\n" +"Returns True if the module name corresponds to a built-in module."); -#define _IMP_IS_BUILTIN_METHODDEF \ - {"is_builtin", (PyCFunction)_imp_is_builtin, METH_O, _imp_is_builtin__doc__}, +#define _IMP_IS_BUILTIN_METHODDEF \ + {"is_builtin", (PyCFunction)_imp_is_builtin, METH_O, _imp_is_builtin__doc__}, -static PyObject *_imp_is_builtin_impl(PyObject *module, PyObject *name); +static PyObject * +_imp_is_builtin_impl(PyObject *module, PyObject *name); -static PyObject *_imp_is_builtin(PyObject *module, PyObject *arg) { - PyObject *return_value = NULL; - PyObject *name; +static PyObject * +_imp_is_builtin(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *name; - if (!PyArg_Parse(arg, "U:is_builtin", &name)) { - goto exit; - } - return_value = _imp_is_builtin_impl(module, name); + if (!PyArg_Parse(arg, "U:is_builtin", &name)) { + goto exit; + } + return_value = _imp_is_builtin_impl(module, name); exit: - return return_value; + return return_value; } PyDoc_STRVAR(_imp_is_frozen__doc__, - "is_frozen($module, name, /)\n" - "--\n" - "\n" - "Returns True if the module name corresponds to a frozen module."); +"is_frozen($module, name, /)\n" +"--\n" +"\n" +"Returns True if the module name corresponds to a frozen module."); -#define _IMP_IS_FROZEN_METHODDEF \ - {"is_frozen", (PyCFunction)_imp_is_frozen, METH_O, _imp_is_frozen__doc__}, +#define _IMP_IS_FROZEN_METHODDEF \ + {"is_frozen", (PyCFunction)_imp_is_frozen, METH_O, _imp_is_frozen__doc__}, -static PyObject *_imp_is_frozen_impl(PyObject *module, PyObject *name); +static PyObject * +_imp_is_frozen_impl(PyObject *module, PyObject *name); -static PyObject *_imp_is_frozen(PyObject *module, PyObject *arg) { - PyObject *return_value = NULL; - PyObject *name; +static PyObject * +_imp_is_frozen(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *name; - if (!PyArg_Parse(arg, "U:is_frozen", &name)) { - goto exit; - } - return_value = _imp_is_frozen_impl(module, name); + if (!PyArg_Parse(arg, "U:is_frozen", &name)) { + goto exit; + } + return_value = _imp_is_frozen_impl(module, name); exit: - return return_value; + return return_value; } #if defined(HAVE_DYNAMIC_LOADING) PyDoc_STRVAR(_imp_create_dynamic__doc__, - "create_dynamic($module, spec, file=None, /)\n" - "--\n" - "\n" - "Create an extension module."); +"create_dynamic($module, spec, file=None, /)\n" +"--\n" +"\n" +"Create an extension module."); -#define _IMP_CREATE_DYNAMIC_METHODDEF \ - {"create_dynamic", (PyCFunction)_imp_create_dynamic, METH_VARARGS, \ - _imp_create_dynamic__doc__}, +#define _IMP_CREATE_DYNAMIC_METHODDEF \ + {"create_dynamic", (PyCFunction)_imp_create_dynamic, METH_VARARGS, _imp_create_dynamic__doc__}, -static PyObject *_imp_create_dynamic_impl(PyObject *module, PyObject *spec, - PyObject *file); +static PyObject * +_imp_create_dynamic_impl(PyObject *module, PyObject *spec, PyObject *file); -static PyObject *_imp_create_dynamic(PyObject *module, PyObject *args) { - PyObject *return_value = NULL; - PyObject *spec; - PyObject *file = NULL; +static PyObject * +_imp_create_dynamic(PyObject *module, PyObject *args) +{ + PyObject *return_value = NULL; + PyObject *spec; + PyObject *file = NULL; - if (!PyArg_UnpackTuple(args, "create_dynamic", 1, 2, &spec, &file)) { - goto exit; - } - return_value = _imp_create_dynamic_impl(module, spec, file); + if (!PyArg_UnpackTuple(args, "create_dynamic", + 1, 2, + &spec, &file)) { + goto exit; + } + return_value = _imp_create_dynamic_impl(module, spec, file); exit: - return return_value; + return return_value; } #endif /* defined(HAVE_DYNAMIC_LOADING) */ #if defined(HAVE_DYNAMIC_LOADING) -PyDoc_STRVAR(_imp_exec_dynamic__doc__, "exec_dynamic($module, mod, /)\n" - "--\n" - "\n" - "Initialize an extension module."); +PyDoc_STRVAR(_imp_exec_dynamic__doc__, +"exec_dynamic($module, mod, /)\n" +"--\n" +"\n" +"Initialize an extension module."); -#define _IMP_EXEC_DYNAMIC_METHODDEF \ - {"exec_dynamic", (PyCFunction)_imp_exec_dynamic, METH_O, \ - _imp_exec_dynamic__doc__}, +#define _IMP_EXEC_DYNAMIC_METHODDEF \ + {"exec_dynamic", (PyCFunction)_imp_exec_dynamic, METH_O, _imp_exec_dynamic__doc__}, -static int _imp_exec_dynamic_impl(PyObject *module, PyObject *mod); +static int +_imp_exec_dynamic_impl(PyObject *module, PyObject *mod); -static PyObject *_imp_exec_dynamic(PyObject *module, PyObject *mod) { - PyObject *return_value = NULL; - int _return_value; +static PyObject * +_imp_exec_dynamic(PyObject *module, PyObject *mod) +{ + PyObject *return_value = NULL; + int _return_value; - _return_value = _imp_exec_dynamic_impl(module, mod); - if ((_return_value == -1) && PyErr_Occurred()) { - goto exit; - } - return_value = PyLong_FromLong((long)_return_value); + _return_value = _imp_exec_dynamic_impl(module, mod); + if ((_return_value == -1) && PyErr_Occurred()) { + goto exit; + } + return_value = PyLong_FromLong((long)_return_value); exit: - return return_value; + return return_value; } #endif /* defined(HAVE_DYNAMIC_LOADING) */ -PyDoc_STRVAR(_imp_exec_builtin__doc__, "exec_builtin($module, mod, /)\n" - "--\n" - "\n" - "Initialize a built-in module."); +PyDoc_STRVAR(_imp_exec_builtin__doc__, +"exec_builtin($module, mod, /)\n" +"--\n" +"\n" +"Initialize a built-in module."); -#define _IMP_EXEC_BUILTIN_METHODDEF \ - {"exec_builtin", (PyCFunction)_imp_exec_builtin, METH_O, \ - _imp_exec_builtin__doc__}, +#define _IMP_EXEC_BUILTIN_METHODDEF \ + {"exec_builtin", (PyCFunction)_imp_exec_builtin, METH_O, _imp_exec_builtin__doc__}, -static int _imp_exec_builtin_impl(PyObject *module, PyObject *mod); +static int +_imp_exec_builtin_impl(PyObject *module, PyObject *mod); -static PyObject *_imp_exec_builtin(PyObject *module, PyObject *mod) { - PyObject *return_value = NULL; - int _return_value; +static PyObject * +_imp_exec_builtin(PyObject *module, PyObject *mod) +{ + PyObject *return_value = NULL; + int _return_value; - _return_value = _imp_exec_builtin_impl(module, mod); - if ((_return_value == -1) && PyErr_Occurred()) { - goto exit; - } - return_value = PyLong_FromLong((long)_return_value); + _return_value = _imp_exec_builtin_impl(module, mod); + if ((_return_value == -1) && PyErr_Occurred()) { + goto exit; + } + return_value = PyLong_FromLong((long)_return_value); exit: - return return_value; + return return_value; } #ifndef _IMP_CREATE_DYNAMIC_METHODDEF -#define _IMP_CREATE_DYNAMIC_METHODDEF + #define _IMP_CREATE_DYNAMIC_METHODDEF #endif /* !defined(_IMP_CREATE_DYNAMIC_METHODDEF) */ #ifndef _IMP_EXEC_DYNAMIC_METHODDEF -#define _IMP_EXEC_DYNAMIC_METHODDEF + #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=d24d7f73702a907f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5a3f012344950548 input=a9049054013a1b77]*/