18 Jun
2019
18 Jun
'19
1:25 p.m.
Hello all,
Victor Stinner recently added the function PyObject_CallNoArgs() for calling an object without any arguments, see https://docs.python.org/3.9/c-api/object.html#c.PyObject_CallNoArgs
The next obvious question is: should we have PyObject_CallOneArg(), PyObject_CallTwoArgs()? Of course, this cannot continue forever, so I suggest adding the 1 and 2 argument variants which would cover most use cases. Cython has something like that and it becomes very natural to use these functions.
The main advantage is that we can implement these variants much more efficiently than the existing PyObject_CallFunction() or PyObject_CallFunctionObjArgs().