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 <1487067186.32.0.661621168555.issue29548@psf.upfronthosting.co.za>
In-reply-to
Content
"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?
History
Date User Action Args
2017-02-14 10:13:06vstinnersetrecipients: + vstinner, lemburg, mark.dickinson, methane, serhiy.storchaka
2017-02-14 10:13:06vstinnersetmessageid: <1487067186.32.0.661621168555.issue29548@psf.upfronthosting.co.za>
2017-02-14 10:13:06vstinnerlinkissue29548 messages
2017-02-14 10:13:06vstinnercreate