On 2019-06-13 18:03, Inada Naoki wrote:
We don't provide method calling API which uses optimization same to LOAD_METHOD. Which may be like this:
/* methname is Unicode, nargs > 0, and args is self. */ PyObject_VectorCallMethod(PyObject *methname, PyObject **args, Py_ssize_t nargs, PyObject *kwds)
I agree that this would be useful. Minor nitpick: we spell "Vectorcall" with a lower-case "c".
There should also be a _Py_Identifier variant _PyObject_VectorcallMethodId
The implementation should be like vectorcall_method from Objects/typeobject.c except that _PyObject_GetMethod should be used instead of lookup_method() (the difference is that the code for special methods like __add__ only looks at the attributes of the type, not the instance).
(Would you try adding this? Or may I?)
Or course you may. Just let me know if you're working on it.