19 Jun
2019
19 Jun
'19
4:35 p.m.
On 2019-06-18 21:11, Brett Cannon wrote:
How hard would it be to analyze the cpython repo and see how common the various ways of calling code is?
I did a quick count of calls being done using PyObject_CallFunction(), PyObject_CallFunctionObjArgs() and _PyObject_FastCall():
- There are 94 calls with 1 positional argument.
- There are 20 calls with 2 positional arguments.
- There are 11 calls with 3 positional arguments.
- There are 4 calls with 4 or more positional arguments.
Personally, I think that this is sufficient to justify the addition of the extra convenience functions for 1, 2 and maybe even 3 positional arguments.