summaryrefslogtreecommitdiffstats
path: root/Modules/_io/clinic/fileio.c.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-01-17 00:35:17 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-01-17 00:35:17 (GMT)
commit259f0e4437ed30036578aba822560feb531b7735 (patch)
tree2ed9ead4992b791c76e1d52e0db3d1cd0516ec11 /Modules/_io/clinic/fileio.c.h
parent0c8c3893ae29fab8ce9db0c2f5b52acbe89032e1 (diff)
downloadcpython-259f0e4437ed30036578aba822560feb531b7735.zip
cpython-259f0e4437ed30036578aba822560feb531b7735.tar.gz
cpython-259f0e4437ed30036578aba822560feb531b7735.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 only positional arguments.
Diffstat (limited to 'Modules/_io/clinic/fileio.c.h')
-rw-r--r--Modules/_io/clinic/fileio.c.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h
index 908fe0f..411a8c0 100644
--- a/Modules/_io/clinic/fileio.c.h
+++ b/Modules/_io/clinic/fileio.c.h
@@ -202,21 +202,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:
@@ -274,22 +278,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:
@@ -373,4 +381,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]*/