You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pep-0590.rst
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,15 +58,19 @@ This is implemented by the function pointer type:
58
58
Changes to the ``PyTypeObject``
59
59
-------------------------------
60
60
61
-
The a new slot called ``tp_vectorcall_offset`` is added. It has the type ``uint32_t``.
62
-
A new flag is added, ``Py_TPFLAGS_HAVE_VECTORCALL``, which is set for any new PyTypeObjects that include the
61
+
The unused slot ``printfunc tp_print`` is replaced with ``tp_vectorcall_offset``. It has the type ``uintptr_t``.
62
+
63
+
A new flag is added, ``Py_TPFLAGS_HAVE_VECTORCALL``, which is set for any new PyTypeObjects that use the
63
64
``tp_vectorcall_offset`` member.
64
65
65
66
If ``Py_TPFLAGS_HAVE_VECTORCALL`` is set then ``tp_vectorcall_offset`` is the offset
66
67
into the object of the ``vectorcall`` function-pointer.
68
+
A new slot ``tp_vectorcall`` is added so that classes can support the vectorcall calling convention.
69
+
It has the type ``vectorcall``.
70
+
71
+
The ``tp_print`` slot is reused as the ``tp_vectorcall_offset`` slot to make it easier for for external projects to backport the vectorcall protocol to earlier Python versions.
72
+
In particular, the Cython project has shown interest in doing that (see https://mail.python.org/pipermail/python-dev/2018-June/153927.html).
67
73
68
-
The unused slot ``printfunc tp_print`` is replaced with ``vectorcall tp_vectorcall``, so that classes
0 commit comments