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/clinic/sha1module.c.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Modules/clinic/sha1module.c.h') diff --git a/Modules/clinic/sha1module.c.h b/Modules/clinic/sha1module.c.h index fa865baec8..6d3fa64334 100644 --- a/Modules/clinic/sha1module.c.h +++ b/Modules/clinic/sha1module.c.h @@ -85,11 +85,12 @@ _sha1_sha1(PyModuleDef *module, PyObject *args, PyObject *kwargs) PyObject *string = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:sha1", _keywords, - &string)) + &string)) { goto exit; + } return_value = _sha1_sha1_impl(module, string); exit: return return_value; } -/*[clinic end generated code: output=be19102f3120490a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=40df3f8955919e72 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/clinic/sha1module.c.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Modules/clinic/sha1module.c.h') diff --git a/Modules/clinic/sha1module.c.h b/Modules/clinic/sha1module.c.h index 8030fbde00..19727621d4 100644 --- a/Modules/clinic/sha1module.c.h +++ b/Modules/clinic/sha1module.c.h @@ -81,10 +81,11 @@ static PyObject * _sha1_sha1(PyObject *module, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - static char *_keywords[] = {"string", NULL}; + static const char * const _keywords[] = {"string", NULL}; + static _PyArg_Parser _parser = {"|O:sha1", _keywords, 0}; PyObject *string = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:sha1", _keywords, + if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, &string)) { goto exit; } @@ -93,4 +94,4 @@ _sha1_sha1(PyObject *module, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=475c4cc749ab31b1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=549a5d08c248337d input=a9049054013a1b77]*/ -- cgit v1.2.1 From daa2ed44798ad45ac665321cae21a23661d0e044 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 9 Sep 2016 20:00:13 -0700 Subject: Issue #27810: Rerun Argument Clinic on all modules --- Modules/clinic/sha1module.c.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Modules/clinic/sha1module.c.h') diff --git a/Modules/clinic/sha1module.c.h b/Modules/clinic/sha1module.c.h index 19727621d4..b08e92d099 100644 --- a/Modules/clinic/sha1module.c.h +++ b/Modules/clinic/sha1module.c.h @@ -72,20 +72,20 @@ PyDoc_STRVAR(_sha1_sha1__doc__, "Return a new SHA1 hash object; optionally initialized with a string."); #define _SHA1_SHA1_METHODDEF \ - {"sha1", (PyCFunction)_sha1_sha1, METH_VARARGS|METH_KEYWORDS, _sha1_sha1__doc__}, + {"sha1", (PyCFunction)_sha1_sha1, METH_FASTCALL, _sha1_sha1__doc__}, static PyObject * _sha1_sha1_impl(PyObject *module, PyObject *string); static PyObject * -_sha1_sha1(PyObject *module, PyObject *args, PyObject *kwargs) +_sha1_sha1(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; static const char * const _keywords[] = {"string", NULL}; static _PyArg_Parser _parser = {"|O:sha1", _keywords, 0}; PyObject *string = NULL; - if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, &string)) { goto exit; } @@ -94,4 +94,4 @@ _sha1_sha1(PyObject *module, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=549a5d08c248337d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1430450f3f806895 input=a9049054013a1b77]*/ -- cgit v1.2.1