Feature or enhancement
The tp_vectorcall slot can be used with static types to define a more efficient implementation of __new__ / __init__. This slot does not have a typedef in typeslots.h, so it cannot currently be set for PyType_FromSpec or read using PyType_GetSlot.
In 3.12 other vectorcall functionality looks set to stabilise, so please consider adding a Py_tp_vectorcall typedef and allow heap types to set / get this member.
Pitch
Adding the ability for tp_vectorcall to be used in the limited API enables extension types to make use of the vectorcall optimisation in more functionality.
Previous discussion
I see in #85784 that tp_vectorcall is deliberately inaccessible with PyType_GetSlot because it is not part of the limited API.
If there is support for this proposal, I am happy to have a first stab at implementation.
Linked PRs
Feature or enhancement
The
tp_vectorcallslot can be used with static types to define a more efficient implementation of__new__/__init__. This slot does not have a typedef in typeslots.h, so it cannot currently be set forPyType_FromSpecor read usingPyType_GetSlot.In 3.12 other vectorcall functionality looks set to stabilise, so please consider adding a
Py_tp_vectorcalltypedef and allow heap types to set / get this member.Pitch
Adding the ability for
tp_vectorcallto be used in the limited API enables extension types to make use of the vectorcall optimisation in more functionality.Previous discussion
I see in #85784 that
tp_vectorcallis deliberately inaccessible withPyType_GetSlotbecause it is not part of the limited API.If there is support for this proposal, I am happy to have a first stab at implementation.
Linked PRs
Py_tp_vectorcallslot to setPyTypeObject.tp_vectorcallusing thePyType_FromSpecfunction family. #123332