diff options
author | adphrost <104581013+adphrost@users.noreply.github.com> | 2022-09-15 15:42:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-15 15:42:37 (GMT) |
commit | a41ed975e863ae0ca435783596f14f8492d62f8d (patch) | |
tree | b87ceae5a7c55e1131a7cdf02b0cda2b6ca41eaf /Doc | |
parent | e37ac5fbb6de593521cf218aa05bc58a45c5a7c9 (diff) | |
download | cpython-a41ed975e863ae0ca435783596f14f8492d62f8d.zip cpython-a41ed975e863ae0ca435783596f14f8492d62f8d.tar.gz cpython-a41ed975e863ae0ca435783596f14f8492d62f8d.tar.bz2 |
GH-91049: Introduce set vectorcall field API for PyFunctionObject (GH-92257)
Co-authored-by: Andrew Frost <adfrost@fb.com>
Co-authored-by: Itamar Ostricher <itamarost@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/function.rst | 9 | ||||
-rw-r--r-- | Doc/whatsnew/3.12.rst | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/Doc/c-api/function.rst b/Doc/c-api/function.rst index 56c1839..df88e85 100644 --- a/Doc/c-api/function.rst +++ b/Doc/c-api/function.rst @@ -83,6 +83,15 @@ There are a few functions specific to Python functions. Raises :exc:`SystemError` and returns ``-1`` on failure. +.. c:function:: void PyFunction_SetVectorcall(PyFunctionObject *func, vectorcallfunc vectorcall) + + Set the vectorcall field of a given function object *func*. + + Warning: extensions using this API must preserve the behavior + of the unaltered (default) vectorcall function! + + .. versionadded:: 3.12 + .. c:function:: PyObject* PyFunction_GetClosure(PyObject *op) Return the closure associated with the function object *op*. This can be ``NULL`` diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 4a6b9c0..90355a7 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -493,6 +493,10 @@ New Features functions in all running threads in addition to the calling one. (Contributed by Pablo Galindo in :gh:`93503`.) +* Added new function :c:func:`PyFunction_SetVectorcall` to the C API + which sets the vectorcall field of a given :c:type:`PyFunctionObject`. + (Contributed by Andrew Frost in :gh:`92257`.) + Porting to Python 3.12 ---------------------- |