HPySlice_Unpack implemented as full API/ABI function
HPySlice_AdjustIndices implemented as inline helper function. This one would not even need the context since it is actually just doing some arithmetic on the given arguments but for consistency, it still has a HPyContext *ctx argument.
This PR also includes some other small fixes:
Minor fixes for Python 3.12 compatibility
Fix missing NULL terminator in test template
Fix caption level in contributing docs
Implement format specifier 'n' (HPy_ssize_t) in HPy_BuildValue. Not sure why we didn't have it since we already have it in HPyArg_Parse.
We incorrectly used return type int for ctx_ContextVar_Get in ctx_funcs.h (should be type int32_t).
Two more functions required for NumPy/HPy:
HPySlice_Unpack
implemented as full API/ABI functionHPySlice_AdjustIndices
implemented as inline helper function. This one would not even need the context since it is actually just doing some arithmetic on the given arguments but for consistency, it still has aHPyContext *ctx
argument.This PR also includes some other small fixes:
NULL
terminator in test template'n'
(HPy_ssize_t
) inHPy_BuildValue
. Not sure why we didn't have it since we already have it inHPyArg_Parse
.int
forctx_ContextVar_Get
inctx_funcs.h
(should be typeint32_t
).