From: Raymond Hettinger Date: Tue, 6 May 2003 09:01:41 +0000 (+0000) Subject: SF bug #692959: new.function ignores keyword arguments X-Git-Tag: v2.3c1~843 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8657845e02b1cd4e2e87ae85f538c66160ec187f;p=python SF bug #692959: new.function ignores keyword arguments --- diff --git a/Objects/funcobject.c b/Objects/funcobject.c index af34392fda..8f2d8df509 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -316,8 +316,11 @@ func_new(PyTypeObject* type, PyObject* args, PyObject* kw) PyObject *closure = Py_None; PyFunctionObject *newfunc; int nfree, nclosure; + static char *kwlist[] = {"code", "globals", "name", + "argdefs", "closure", 0}; - if (!PyArg_ParseTuple(args, "O!O!|OOO:function", + if (!PyArg_ParseTupleAndKeywords(args, kw, "O!O!|OOO:function", + kwlist, &PyCode_Type, &code, &PyDict_Type, &globals, &name, &defaults, &closure))