From 11b4bcace26b189c34d7ef00eef43665febc1d21 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Thu, 3 Nov 2022 13:02:14 +0100 Subject: [PATCH 1/7] gh-98586: add whatsnew entry, related documentation fix PR #98587 addressing issue #98586 lacked a "what's new" entry. While making those changes, I noticed an inconsistency in how ``PY_VECTORCALL_ARGUMENTS_OFFSET`` is declared in the underlying Sphinx markup when compared to other macro constants like ``Py_TPFLAGS_HAVE_VECTORCALL``. This PR fixes that as well, which should connect a few currently broken cross-references --- Doc/c-api/call.rst | 2 +- Doc/whatsnew/3.12.rst | 12 ++++++++++++ .../2022-10-24-10-30-30.gh-issue-98586.Tha5Iy.rst | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/call.rst b/Doc/c-api/call.rst index 6fb2e15196103d..4dc66e318cd12e 100644 --- a/Doc/c-api/call.rst +++ b/Doc/c-api/call.rst @@ -93,7 +93,7 @@ This is a pointer to a function with the following signature: and they must be unique. If there are no keyword arguments, then *kwnames* can instead be *NULL*. -.. c:macro:: PY_VECTORCALL_ARGUMENTS_OFFSET +.. data:: PY_VECTORCALL_ARGUMENTS_OFFSET If this flag is set in a vectorcall *nargsf* argument, the callee is allowed to temporarily change ``args[-1]``. In other words, *args* points to diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index a9432561f3fc50..b29c86440640e8 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -622,6 +622,18 @@ New Features ``__dict__`` and weakrefs with less bookkeeping, using less memory and with faster access. +* API for performing calls using the + :ref:`the vectorcall protocol ` was added to the + :ref:`Limited API `: + + * :c:func:`PyObject_Vectorcall` + * :c:func:`PyObject_VectorcallMethod` + * :const:`Py_TPFLAGS_HAVE_VECTORCALL` + + Together with the previous change, this covers both receiving and outgoing + ends of the vector call protocol. (Contributed by Wenzel Jakob in + :gh:`98586`.) + * Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-10-24-10-30-30.gh-issue-98586.Tha5Iy.rst b/Misc/NEWS.d/next/Core and Builtins/2022-10-24-10-30-30.gh-issue-98586.Tha5Iy.rst index 5d7b0c89249657..6a1ae3568a1704 100644 --- a/Misc/NEWS.d/next/Core and Builtins/2022-10-24-10-30-30.gh-issue-98586.Tha5Iy.rst +++ b/Misc/NEWS.d/next/Core and Builtins/2022-10-24-10-30-30.gh-issue-98586.Tha5Iy.rst @@ -1,6 +1,6 @@ Added the methods :c:func:`PyObject_Vectorcall` and :c:func:`PyObject_VectorcallMethod` to the :ref:`Limited API ` along -with the auxiliary macro constant :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`. +with the auxiliary macro constant :const:`PY_VECTORCALL_ARGUMENTS_OFFSET`. The availability of these functions enables more efficient :PEP:`590` vector calls from binary extension modules that avoid argument boxing/unboxing From def3757aba14f747f804f79731336f3637d58e20 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Thu, 3 Nov 2022 13:09:39 +0100 Subject: [PATCH 2/7] removed repeated word --- Doc/whatsnew/3.12.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index b29c86440640e8..1ed6c3028df7f9 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -622,7 +622,7 @@ New Features ``__dict__`` and weakrefs with less bookkeeping, using less memory and with faster access. -* API for performing calls using the +* API for performing calls using :ref:`the vectorcall protocol ` was added to the :ref:`Limited API `: From c49341129df0cfc44a70a60133419dc5af61a804 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Thu, 3 Nov 2022 20:39:08 +0100 Subject: [PATCH 3/7] Add extra article Co-authored-by: C.A.M. Gerlach --- Doc/whatsnew/3.12.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 1ed6c3028df7f9..3fc9f098eb3a99 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -630,7 +630,7 @@ New Features * :c:func:`PyObject_VectorcallMethod` * :const:`Py_TPFLAGS_HAVE_VECTORCALL` - Together with the previous change, this covers both receiving and outgoing + Together with the previous change, this covers both the receiving and outgoing ends of the vector call protocol. (Contributed by Wenzel Jakob in :gh:`98586`.) From 862307c047d1b7a0932fe31c6b4696d548803b1c Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Thu, 3 Nov 2022 23:11:50 +0100 Subject: [PATCH 4/7] Update Doc/whatsnew/3.12.rst Co-authored-by: C.A.M. Gerlach --- Doc/whatsnew/3.12.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 3fc9f098eb3a99..377c1e19e3203a 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -630,7 +630,7 @@ New Features * :c:func:`PyObject_VectorcallMethod` * :const:`Py_TPFLAGS_HAVE_VECTORCALL` - Together with the previous change, this covers both the receiving and outgoing + Together with the previous change, this covers both the incoming and outgoing ends of the vector call protocol. (Contributed by Wenzel Jakob in :gh:`98586`.) From c7517df5aba64ed4b2bab61a160e7adeaa7cd552 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Fri, 4 Nov 2022 12:36:53 +0100 Subject: [PATCH 5/7] fixed referenced macro constant --- Doc/whatsnew/3.12.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 377c1e19e3203a..e6c0f748a22abf 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -628,7 +628,7 @@ New Features * :c:func:`PyObject_Vectorcall` * :c:func:`PyObject_VectorcallMethod` - * :const:`Py_TPFLAGS_HAVE_VECTORCALL` + * :const:`PY_VECTORCALL_ARGUMENTS_OFFSET` Together with the previous change, this covers both the incoming and outgoing ends of the vector call protocol. (Contributed by Wenzel Jakob in From 4d0c68bb5ba4c622c1a8d2365d9ea565dd7a1884 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Fri, 4 Nov 2022 12:58:13 +0100 Subject: [PATCH 6/7] rephrase --- Doc/whatsnew/3.12.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index e6c0f748a22abf..653bd5dfdd7ca1 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -623,16 +623,16 @@ New Features using less memory and with faster access. * API for performing calls using - :ref:`the vectorcall protocol ` was added to the + :ref:`the vectorcall protocol ` was also added to the :ref:`Limited API `: * :c:func:`PyObject_Vectorcall` * :c:func:`PyObject_VectorcallMethod` * :const:`PY_VECTORCALL_ARGUMENTS_OFFSET` - Together with the previous change, this covers both the incoming and outgoing - ends of the vector call protocol. (Contributed by Wenzel Jakob in - :gh:`98586`.) + This means that both the incoming and outgoing ends of the vector call + protocol are now available in the :ref:`Limited API `. (Contributed + by Wenzel Jakob in :gh:`98586`.) * Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and From c55a974966b68e8b083953c169965e0831e1b284 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Fri, 4 Nov 2022 13:05:17 +0100 Subject: [PATCH 7/7] Update Doc/whatsnew/3.12.rst Co-authored-by: Erlend E. Aasland --- Doc/whatsnew/3.12.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 653bd5dfdd7ca1..b84e02c66610ae 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -623,7 +623,7 @@ New Features using less memory and with faster access. * API for performing calls using - :ref:`the vectorcall protocol ` was also added to the + :ref:`the vectorcall protocol ` was added to the :ref:`Limited API `: * :c:func:`PyObject_Vectorcall`