From a397e56d2aad76fe5cacd54a2ecbdb03702985c7 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 9 Jun 2016 16:16:06 +0300 Subject: Issue #26305: Argument Clinic now uses braces in C code as required by PEP 7. --- Modules/_io/clinic/_iomodule.c.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Modules/_io/clinic/_iomodule.c.h') diff --git a/Modules/_io/clinic/_iomodule.c.h b/Modules/_io/clinic/_iomodule.c.h index a3abb93cc7..6dcfc0812d 100644 --- a/Modules/_io/clinic/_iomodule.c.h +++ b/Modules/_io/clinic/_iomodule.c.h @@ -149,11 +149,12 @@ _io_open(PyModuleDef *module, PyObject *args, PyObject *kwargs) PyObject *opener = Py_None; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|sizzziO:open", _keywords, - &file, &mode, &buffering, &encoding, &errors, &newline, &closefd, &opener)) + &file, &mode, &buffering, &encoding, &errors, &newline, &closefd, &opener)) { goto exit; + } return_value = _io_open_impl(module, file, mode, buffering, encoding, errors, newline, closefd, opener); exit: return return_value; } -/*[clinic end generated code: output=97cdc09bf68a8064 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=079f597e71e9f0c6 input=a9049054013a1b77]*/ -- cgit v1.2.1 From 96d299b2b87dd2311bcc94cbab7b1cfa2c30ccba Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 14 Aug 2016 10:52:18 +0300 Subject: Issue #27574: Decreased an overhead of parsing keyword arguments in functions implemented with using Argument Clinic. --- Modules/_io/clinic/_iomodule.c.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Modules/_io/clinic/_iomodule.c.h') diff --git a/Modules/_io/clinic/_iomodule.c.h b/Modules/_io/clinic/_iomodule.c.h index ee01cfb7b3..50891c59d1 100644 --- a/Modules/_io/clinic/_iomodule.c.h +++ b/Modules/_io/clinic/_iomodule.c.h @@ -138,7 +138,8 @@ static PyObject * _io_open(PyObject *module, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - static char *_keywords[] = {"file", "mode", "buffering", "encoding", "errors", "newline", "closefd", "opener", NULL}; + static const char * const _keywords[] = {"file", "mode", "buffering", "encoding", "errors", "newline", "closefd", "opener", NULL}; + static _PyArg_Parser _parser = {"O|sizzziO:open", _keywords, 0}; PyObject *file; const char *mode = "r"; int buffering = -1; @@ -148,7 +149,7 @@ _io_open(PyObject *module, PyObject *args, PyObject *kwargs) int closefd = 1; PyObject *opener = Py_None; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|sizzziO:open", _keywords, + if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, &file, &mode, &buffering, &encoding, &errors, &newline, &closefd, &opener)) { goto exit; } @@ -157,4 +158,4 @@ _io_open(PyObject *module, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=ae2facf262cf464e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=14769629391a3130 input=a9049054013a1b77]*/ -- cgit v1.2.1 From cbe82eb2f490b35235e2bfc4a5687b69514d2bd2 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 11 Sep 2016 21:25:45 +0300 Subject: Issue #27810: Regenerate Argument Clinic. --- Modules/_io/clinic/_iomodule.c.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Modules/_io/clinic/_iomodule.c.h') diff --git a/Modules/_io/clinic/_iomodule.c.h b/Modules/_io/clinic/_iomodule.c.h index 50891c59d1..f2e91a9fe6 100644 --- a/Modules/_io/clinic/_iomodule.c.h +++ b/Modules/_io/clinic/_iomodule.c.h @@ -127,7 +127,7 @@ PyDoc_STRVAR(_io_open__doc__, "opened in a binary mode."); #define _IO_OPEN_METHODDEF \ - {"open", (PyCFunction)_io_open, METH_VARARGS|METH_KEYWORDS, _io_open__doc__}, + {"open", (PyCFunction)_io_open, METH_FASTCALL, _io_open__doc__}, static PyObject * _io_open_impl(PyObject *module, PyObject *file, const char *mode, @@ -135,7 +135,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode, const char *newline, int closefd, PyObject *opener); static PyObject * -_io_open(PyObject *module, PyObject *args, PyObject *kwargs) +_io_open(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; static const char * const _keywords[] = {"file", "mode", "buffering", "encoding", "errors", "newline", "closefd", "opener", NULL}; @@ -149,7 +149,7 @@ _io_open(PyObject *module, PyObject *args, PyObject *kwargs) int closefd = 1; PyObject *opener = Py_None; - if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, &file, &mode, &buffering, &encoding, &errors, &newline, &closefd, &opener)) { goto exit; } @@ -158,4 +158,4 @@ _io_open(PyObject *module, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=14769629391a3130 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c5b8fc8b83102bbf input=a9049054013a1b77]*/ -- cgit v1.2.1