Message287759
"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:06 | vstinner | set | recipients:
+ vstinner, lemburg, mark.dickinson, methane, serhiy.storchaka |
2017-02-14 10:13:06 | vstinner | set | messageid: <1487067186.32.0.661621168555.issue29548@psf.upfronthosting.co.za> |
2017-02-14 10:13:06 | vstinner | link | issue29548 messages |
2017-02-14 10:13:06 | vstinner | create | |
|