Author vstinner
Recipients lemburg, mark.dickinson, methane, serhiy.storchaka, vstinner
Date 2017-02-14.10:13:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
"you now add the extra support for args being NULL to PyObject_Call()"

I dislike this idea. I don't want to change the API of this function.

If it is likely that NULL is the result of a previous error:

args = Py_BuildValue(...);
res = PyObject_Call(func, args, NULL);

There are already enough ways to call a function with no argument:

res = PyObject_CallFunction(func, NULL);
res = PyObject_CallFunctionObjArgs(func, NULL);
res = _PyObject_CallNoArg(func)   # private

If you want to call a function only with keyword arguments, well, create an empty tuple ... which is a singleton in CPython, no risk of memory allocation failure ... and use PyObject_Call(), no?
Date User Action Args
2017-02-14 10:13:06vstinnersetrecipients: + vstinner, lemburg, mark.dickinson, methane, serhiy.storchaka
2017-02-14 10:13:06vstinnersetmessageid: <>
2017-02-14 10:13:06vstinnerlinkissue29548 messages
2017-02-14 10:13:06vstinnercreate