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[0] 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.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/python-dev@python.org/message/FLF74RH3XO4BYOTW2CRRD2GO23P2YUOO/