summaryrefslogtreecommitdiff
path: root/Modules/_io/clinic/bytesio.c.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-01-17 02:21:47 +0100
committerVictor Stinner <victor.stinner@gmail.com>2017-01-17 02:21:47 +0100
commit104cb4a3bacdf9764f9f8670a80da16390231337 (patch)
tree25a9cc63cf6d87d2f3fdcd043b351d2277ba89d8 /Modules/_io/clinic/bytesio.c.h
parentfb6c0453c94178df82be764dd66a8957e3b8b2b9 (diff)
downloadcpython-104cb4a3bacdf9764f9f8670a80da16390231337.tar.gz
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/bytesio.c.h')
-rw-r--r--Modules/_io/clinic/bytesio.c.h52
1 files changed, 36 insertions, 16 deletions
diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h
index 11b976c503..656e7ecd13 100644
--- a/Modules/_io/clinic/bytesio.c.h
+++ b/Modules/_io/clinic/bytesio.c.h
@@ -158,22 +158,26 @@ PyDoc_STRVAR(_io_BytesIO_read__doc__,
"Return an empty bytes object at EOF.");
#define _IO_BYTESIO_READ_METHODDEF \
- {"read", (PyCFunction)_io_BytesIO_read, METH_VARARGS, _io_BytesIO_read__doc__},
+ {"read", (PyCFunction)_io_BytesIO_read, METH_FASTCALL, _io_BytesIO_read__doc__},
static PyObject *
_io_BytesIO_read_impl(bytesio *self, PyObject *arg);
static PyObject *
-_io_BytesIO_read(bytesio *self, PyObject *args)
+_io_BytesIO_read(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *arg = Py_None;
- if (!PyArg_UnpackTuple(args, "read",
+ if (!_PyArg_UnpackStack(args, nargs, "read",
0, 1,
&arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("read", kwnames)) {
+ goto exit;
+ }
return_value = _io_BytesIO_read_impl(self, arg);
exit:
@@ -190,22 +194,26 @@ PyDoc_STRVAR(_io_BytesIO_read1__doc__,
"Return an empty bytes object at EOF.");
#define _IO_BYTESIO_READ1_METHODDEF \
- {"read1", (PyCFunction)_io_BytesIO_read1, METH_VARARGS, _io_BytesIO_read1__doc__},
+ {"read1", (PyCFunction)_io_BytesIO_read1, METH_FASTCALL, _io_BytesIO_read1__doc__},
static PyObject *
_io_BytesIO_read1_impl(bytesio *self, PyObject *size);
static PyObject *
-_io_BytesIO_read1(bytesio *self, PyObject *args)
+_io_BytesIO_read1(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *size = Py_None;
- if (!PyArg_UnpackTuple(args, "read1",
+ if (!_PyArg_UnpackStack(args, nargs, "read1",
0, 1,
&size)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("read1", kwnames)) {
+ goto exit;
+ }
return_value = _io_BytesIO_read1_impl(self, size);
exit:
@@ -223,22 +231,26 @@ PyDoc_STRVAR(_io_BytesIO_readline__doc__,
"Return an empty bytes object at EOF.");
#define _IO_BYTESIO_READLINE_METHODDEF \
- {"readline", (PyCFunction)_io_BytesIO_readline, METH_VARARGS, _io_BytesIO_readline__doc__},
+ {"readline", (PyCFunction)_io_BytesIO_readline, METH_FASTCALL, _io_BytesIO_readline__doc__},
static PyObject *
_io_BytesIO_readline_impl(bytesio *self, PyObject *arg);
static PyObject *
-_io_BytesIO_readline(bytesio *self, PyObject *args)
+_io_BytesIO_readline(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *arg = Py_None;
- if (!PyArg_UnpackTuple(args, "readline",
+ if (!_PyArg_UnpackStack(args, nargs, "readline",
0, 1,
&arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("readline", kwnames)) {
+ goto exit;
+ }
return_value = _io_BytesIO_readline_impl(self, arg);
exit:
@@ -256,22 +268,26 @@ PyDoc_STRVAR(_io_BytesIO_readlines__doc__,
"total number of bytes in the lines returned.");
#define _IO_BYTESIO_READLINES_METHODDEF \
- {"readlines", (PyCFunction)_io_BytesIO_readlines, METH_VARARGS, _io_BytesIO_readlines__doc__},
+ {"readlines", (PyCFunction)_io_BytesIO_readlines, METH_FASTCALL, _io_BytesIO_readlines__doc__},
static PyObject *
_io_BytesIO_readlines_impl(bytesio *self, PyObject *arg);
static PyObject *
-_io_BytesIO_readlines(bytesio *self, PyObject *args)
+_io_BytesIO_readlines(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *arg = Py_None;
- if (!PyArg_UnpackTuple(args, "readlines",
+ if (!_PyArg_UnpackStack(args, nargs, "readlines",
0, 1,
&arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("readlines", kwnames)) {
+ goto exit;
+ }
return_value = _io_BytesIO_readlines_impl(self, arg);
exit:
@@ -323,22 +339,26 @@ PyDoc_STRVAR(_io_BytesIO_truncate__doc__,
"The current file position is unchanged. Returns the new size.");
#define _IO_BYTESIO_TRUNCATE_METHODDEF \
- {"truncate", (PyCFunction)_io_BytesIO_truncate, METH_VARARGS, _io_BytesIO_truncate__doc__},
+ {"truncate", (PyCFunction)_io_BytesIO_truncate, METH_FASTCALL, _io_BytesIO_truncate__doc__},
static PyObject *
_io_BytesIO_truncate_impl(bytesio *self, PyObject *arg);
static PyObject *
-_io_BytesIO_truncate(bytesio *self, PyObject *args)
+_io_BytesIO_truncate(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *arg = Py_None;
- if (!PyArg_UnpackTuple(args, "truncate",
+ if (!_PyArg_UnpackStack(args, nargs, "truncate",
0, 1,
&arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("truncate", kwnames)) {
+ goto exit;
+ }
return_value = _io_BytesIO_truncate_impl(self, arg);
exit:
@@ -452,4 +472,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs)
exit:
return return_value;
}
-/*[clinic end generated code: output=056f24eece495a8f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=138ee6ad6951bc84 input=a9049054013a1b77]*/