Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added HPySlice_New #481

Merged
merged 4 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/api-reference/function-index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ HPy Core API Function Index
* :c:func:`HPyLong_FromUInt32_t`
* :c:func:`HPyLong_FromUInt64_t`
* :c:func:`HPyNumber_Check`
* :c:func:`HPySlice_New`
* :c:func:`HPySlice_Unpack`
* :c:func:`HPyTracker_Add`
* :c:func:`HPyTracker_Close`
Expand Down
1 change: 1 addition & 0 deletions docs/porting-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ with the code for the :term:`CPython ABI` mode, so it is guaranteed to be correc
`PySequence_GetSlice <https://docs.python.org/3/c-api/sequence.html#c.PySequence_GetSlice>`_ :c:func:`HPy_GetSlice`
`PySequence_SetSlice <https://docs.python.org/3/c-api/sequence.html#c.PySequence_SetSlice>`_ :c:func:`HPy_SetSlice`
`PySlice_AdjustIndices <https://docs.python.org/3/c-api/slice.html#c.PySlice_AdjustIndices>`_ :c:func:`HPySlice_AdjustIndices`
`PySlice_New <https://docs.python.org/3/c-api/slice.html#c.PySlice_New>`_ :c:func:`HPySlice_New`
`PySlice_Unpack <https://docs.python.org/3/c-api/slice.html#c.PySlice_Unpack>`_ :c:func:`HPySlice_Unpack`
`PyTuple_Check <https://docs.python.org/3/c-api/tuple.html#c.PyTuple_Check>`_ :c:func:`HPyTuple_Check`
`PyType_IsSubtype <https://docs.python.org/3/c-api/type.html#c.PyType_IsSubtype>`_ :c:func:`HPyType_IsSubtype`
Expand Down
2 changes: 2 additions & 0 deletions hpy/debug/src/autogen_debug_ctx_init.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions hpy/debug/src/autogen_debug_wrappers.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions hpy/devel/include/hpy/cpython/autogen_api_impl.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions hpy/devel/include/hpy/universal/autogen_ctx.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions hpy/devel/include/hpy/universal/autogen_trampolines.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions hpy/tools/autogen/public_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,19 @@ HPy HPyTuple_FromArray(HPyContext *ctx, const HPy items[], HPy_ssize_t n);

/* sliceobject.h */

/**
* Creates a new empty Python slice object.
*
* :param ctx:
* The execution context.
*
fangerer marked this conversation as resolved.
Show resolved Hide resolved
* :returns:
* A handle to the new and empty Python slice object or ``HPy_NULL`` in case
* of an error.
*/
HPy_ID(272)
HPy HPySlice_New(HPyContext *ctx, HPy start, HPy stop, HPy step);

/**
* Extract the start, stop and step data members from a slice object as C
* integers.
Expand Down Expand Up @@ -987,6 +1000,7 @@ HPy HPyTuple_FromArray(HPyContext *ctx, const HPy items[], HPy_ssize_t n);
* :returns:
* ``-1`` on error, ``0`` on success
*/

HPy_ID(259)
int HPySlice_Unpack(HPyContext *ctx, HPy slice, HPy_ssize_t *start, HPy_ssize_t *stop, HPy_ssize_t *step);

Expand Down
6 changes: 4 additions & 2 deletions hpy/trace/src/autogen_trace_ctx_init.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions hpy/trace/src/autogen_trace_func_table.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions hpy/trace/src/autogen_trace_wrappers.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions hpy/universal/src/autogen_ctx_def.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions hpy/universal/src/autogen_ctx_impl.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading