summaryrefslogtreecommitdiffstats
path: root/Modules/_io/clinic/stringio.c.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-01-17 01:21:47 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-01-17 01:21:47 (GMT)
commit0c4a828cadfccd8b95a39f7930705de75ed5f729 (patch)
tree713eeceb5c63f4324fa83e9603a0284272e9eb58 /Modules/_io/clinic/stringio.c.h
parent093119e4eb8424451ef24a5a5a3ce9881d77abd5 (diff)
downloadcpython-0c4a828cadfccd8b95a39f7930705de75ed5f729.zip
cpython-0c4a828cadfccd8b95a39f7930705de75ed5f729.tar.gz
cpython-0c4a828cadfccd8b95a39f7930705de75ed5f729.tar.bz2
Run Argument Clinic: METH_VARARGS=>METH_FASTCALL
Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling convention for functions using "boring" positional arguments. Manually fix _elementtree: _elementtree_XMLParser_doctype() must remain consistent with the clinic code.
Diffstat (limited to 'Modules/_io/clinic/stringio.c.h')
-rw-r--r--Modules/_io/clinic/stringio.c.h32
1 files changed, 22 insertions, 10 deletions
diff --git a/Modules/_io/clinic/stringio.c.h b/Modules/_io/clinic/stringio.c.h
index e617201..af467d6 100644
--- a/Modules/_io/clinic/stringio.c.h
+++ b/Modules/_io/clinic/stringio.c.h
@@ -48,22 +48,26 @@ PyDoc_STRVAR(_io_StringIO_read__doc__,
"is reached. Return an empty string at EOF.");
#define _IO_STRINGIO_READ_METHODDEF \
- {"read", (PyCFunction)_io_StringIO_read, METH_VARARGS, _io_StringIO_read__doc__},
+ {"read", (PyCFunction)_io_StringIO_read, METH_FASTCALL, _io_StringIO_read__doc__},
static PyObject *
_io_StringIO_read_impl(stringio *self, PyObject *arg);
static PyObject *
-_io_StringIO_read(stringio *self, PyObject *args)
+_io_StringIO_read(stringio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *arg = Py_None;
- if (!PyArg_UnpackTuple(args, "read",
+ if (!_PyArg_UnpackStack(args, nargs, "read",
0, 1,
&arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("read", kwnames)) {
+ goto exit;
+ }
return_value = _io_StringIO_read_impl(self, arg);
exit:
@@ -79,22 +83,26 @@ PyDoc_STRVAR(_io_StringIO_readline__doc__,
"Returns an empty string if EOF is hit immediately.");
#define _IO_STRINGIO_READLINE_METHODDEF \
- {"readline", (PyCFunction)_io_StringIO_readline, METH_VARARGS, _io_StringIO_readline__doc__},
+ {"readline", (PyCFunction)_io_StringIO_readline, METH_FASTCALL, _io_StringIO_readline__doc__},
static PyObject *
_io_StringIO_readline_impl(stringio *self, PyObject *arg);
static PyObject *
-_io_StringIO_readline(stringio *self, PyObject *args)
+_io_StringIO_readline(stringio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *arg = Py_None;
- if (!PyArg_UnpackTuple(args, "readline",
+ if (!_PyArg_UnpackStack(args, nargs, "readline",
0, 1,
&arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("readline", kwnames)) {
+ goto exit;
+ }
return_value = _io_StringIO_readline_impl(self, arg);
exit:
@@ -112,22 +120,26 @@ PyDoc_STRVAR(_io_StringIO_truncate__doc__,
"Returns the new absolute position.");
#define _IO_STRINGIO_TRUNCATE_METHODDEF \
- {"truncate", (PyCFunction)_io_StringIO_truncate, METH_VARARGS, _io_StringIO_truncate__doc__},
+ {"truncate", (PyCFunction)_io_StringIO_truncate, METH_FASTCALL, _io_StringIO_truncate__doc__},
static PyObject *
_io_StringIO_truncate_impl(stringio *self, PyObject *arg);
static PyObject *
-_io_StringIO_truncate(stringio *self, PyObject *args)
+_io_StringIO_truncate(stringio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *arg = Py_None;
- if (!PyArg_UnpackTuple(args, "truncate",
+ if (!_PyArg_UnpackStack(args, nargs, "truncate",
0, 1,
&arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("truncate", kwnames)) {
+ goto exit;
+ }
return_value = _io_StringIO_truncate_impl(self, arg);
exit:
@@ -293,4 +305,4 @@ _io_StringIO_seekable(stringio *self, PyObject *Py_UNUSED(ignored))
{
return _io_StringIO_seekable_impl(self);
}
-/*[clinic end generated code: output=69bf262268745061 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ce8018ec29def422 input=a9049054013a1b77]*/