PEP 590: rename PyCall_MakeVectorCall -> PyVectorcall_Call (GH-1037)

This commit is contained in:
Jeroen Demeyer 2019-05-12 18:46:02 +02:00 committed by Petr Viktorin
parent 468ab6e8a5
commit 1df4f57758
1 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ The following functions or macros are added to the C API:
This uses either the vectorcall protocol or ``tp_call`` internally; This uses either the vectorcall protocol or ``tp_call`` internally;
if neither is supported, an exception is raised. if neither is supported, an exception is raised.
- ``PyObject *PyCall_MakeVectorCall(PyObject *obj, PyObject *tuple, PyObject *dict)``: - ``PyObject *PyVectorcall_Call(PyObject *obj, PyObject *tuple, PyObject *dict)``:
Call the object (which must support vectorcall) with the old Call the object (which must support vectorcall) with the old
``*args`` and ``**kwargs`` calling convention. ``*args`` and ``**kwargs`` calling convention.
This is mostly meant to put in the ``tp_call`` slot. This is mostly meant to put in the ``tp_call`` slot.
@ -216,7 +216,7 @@ To enable call performance on a par with Python functions and built-in functions
third-party callables should include a ``vectorcallfunc`` function pointer, third-party callables should include a ``vectorcallfunc`` function pointer,
set ``tp_vectorcall_offset`` to the correct value and add the ``Py_TPFLAGS_HAVE_VECTORCALL`` flag. set ``tp_vectorcall_offset`` to the correct value and add the ``Py_TPFLAGS_HAVE_VECTORCALL`` flag.
Any class that does this must implement the ``tp_call`` function and make sure its behaviour is consistent with the ``vectorcallfunc`` function. Any class that does this must implement the ``tp_call`` function and make sure its behaviour is consistent with the ``vectorcallfunc`` function.
Setting ``tp_call`` to ``PyCall_MakeVectorCall`` is sufficient. Setting ``tp_call`` to ``PyVectorcall_Call`` is sufficient.
Performance implications of these changes Performance implications of these changes