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/md5module.c.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Modules/clinic/md5module.c.h') diff --git a/Modules/clinic/md5module.c.h b/Modules/clinic/md5module.c.h index f5a3117f10..9c8987eb5e 100644 --- a/Modules/clinic/md5module.c.h +++ b/Modules/clinic/md5module.c.h @@ -85,11 +85,12 @@ _md5_md5(PyModuleDef *module, PyObject *args, PyObject *kwargs) PyObject *string = NULL; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:md5", _keywords, - &string)) + &string)) { goto exit; + } return_value = _md5_md5_impl(module, string); exit: return return_value; } -/*[clinic end generated code: output=0f803ded701aca54 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d701d041d387b081 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/md5module.c.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Modules/clinic/md5module.c.h') diff --git a/Modules/clinic/md5module.c.h b/Modules/clinic/md5module.c.h index 25dc7bb462..aeb1c41118 100644 --- a/Modules/clinic/md5module.c.h +++ b/Modules/clinic/md5module.c.h @@ -81,10 +81,11 @@ static PyObject * _md5_md5(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:md5", _keywords, 0}; PyObject *string = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:md5", _keywords, + if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, &string)) { goto exit; } @@ -93,4 +94,4 @@ _md5_md5(PyObject *module, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=8f640a98761daffe input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f86fc2f3f21831e2 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/md5module.c.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Modules/clinic/md5module.c.h') diff --git a/Modules/clinic/md5module.c.h b/Modules/clinic/md5module.c.h index aeb1c41118..a841fe5786 100644 --- a/Modules/clinic/md5module.c.h +++ b/Modules/clinic/md5module.c.h @@ -72,20 +72,20 @@ PyDoc_STRVAR(_md5_md5__doc__, "Return a new MD5 hash object; optionally initialized with a string."); #define _MD5_MD5_METHODDEF \ - {"md5", (PyCFunction)_md5_md5, METH_VARARGS|METH_KEYWORDS, _md5_md5__doc__}, + {"md5", (PyCFunction)_md5_md5, METH_FASTCALL, _md5_md5__doc__}, static PyObject * _md5_md5_impl(PyObject *module, PyObject *string); static PyObject * -_md5_md5(PyObject *module, PyObject *args, PyObject *kwargs) +_md5_md5(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:md5", _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 @@ _md5_md5(PyObject *module, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=f86fc2f3f21831e2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=54cd50db050f2589 input=a9049054013a1b77]*/ -- cgit v1.2.1