Skip to content
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
Next Next commit
gh-114329: Fix PyList_GetItemRef() limited C API definition
  • Loading branch information
vstinner committed Apr 3, 2024
commit 934a220258404272e132e6b2d446ff740b517b8a
2 changes: 2 additions & 0 deletions Include/listobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ PyAPI_FUNC(PyObject *) PyList_New(Py_ssize_t size);
PyAPI_FUNC(Py_ssize_t) PyList_Size(PyObject *);

PyAPI_FUNC(PyObject *) PyList_GetItem(PyObject *, Py_ssize_t);
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000
PyAPI_FUNC(PyObject *) PyList_GetItemRef(PyObject *, Py_ssize_t);
#endif
PyAPI_FUNC(int) PyList_SetItem(PyObject *, Py_ssize_t, PyObject *);
PyAPI_FUNC(int) PyList_Insert(PyObject *, Py_ssize_t, PyObject *);
PyAPI_FUNC(int) PyList_Append(PyObject *, PyObject *);
Expand Down
5 changes: 5 additions & 0 deletions Modules/_testlimitedcapi/list.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Need limited C API version 3.13 for PyList_GetItemRef()
#if !defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API )
Comment thread
vstinner marked this conversation as resolved.
Outdated
Comment thread
vstinner marked this conversation as resolved.
Outdated
# define Py_LIMITED_API 0x030d0000
#endif

#include "parts.h"
#include "util.h"

Expand Down