1-
21/* Tuple object interface */
32
43#ifndef Py_TUPLEOBJECT_H
@@ -21,18 +20,6 @@ inserted in the tuple. Similarly, PyTuple_GetItem does not increment the
2120returned item's reference count.
2221*/
2322
24- #ifndef Py_LIMITED_API
25- typedef struct {
26- PyObject_VAR_HEAD
27- PyObject * ob_item [1 ];
28-
29- /* ob_item contains space for 'ob_size' elements.
30- * Items must normally not be NULL, except during construction when
31- * the tuple is not yet visible outside the function that builds it.
32- */
33- } PyTupleObject ;
34- #endif
35-
3623PyAPI_DATA (PyTypeObject ) PyTuple_Type ;
3724PyAPI_DATA (PyTypeObject ) PyTupleIter_Type ;
3825
@@ -45,30 +32,15 @@ PyAPI_FUNC(Py_ssize_t) PyTuple_Size(PyObject *);
4532PyAPI_FUNC (PyObject * ) PyTuple_GetItem (PyObject * , Py_ssize_t );
4633PyAPI_FUNC (int ) PyTuple_SetItem (PyObject * , Py_ssize_t , PyObject * );
4734PyAPI_FUNC (PyObject * ) PyTuple_GetSlice (PyObject * , Py_ssize_t , Py_ssize_t );
48- #ifndef Py_LIMITED_API
49- PyAPI_FUNC (int ) _PyTuple_Resize (PyObject * * , Py_ssize_t );
50- #endif
5135PyAPI_FUNC (PyObject * ) PyTuple_Pack (Py_ssize_t , ...);
52- #ifndef Py_LIMITED_API
53- PyAPI_FUNC (void ) _PyTuple_MaybeUntrack (PyObject * );
54- #endif
55-
56- /* Macro, trading safety for speed */
57- #ifndef Py_LIMITED_API
58- /* Cast argument to PyTupleObject* type. */
59- #define _PyTuple_CAST (op ) (assert(PyTuple_Check(op)), (PyTupleObject *)(op))
60-
61- #define PyTuple_GET_ITEM (op , i ) (_PyTuple_CAST(op)->ob_item[i])
62- #define PyTuple_GET_SIZE (op ) Py_SIZE(_PyTuple_CAST(op))
63-
64- /* Macro, *only* to be used to fill in brand new tuples */
65- #define PyTuple_SET_ITEM (op , i , v ) (_PyTuple_CAST(op)->ob_item[i] = v)
66- #endif
6736
6837PyAPI_FUNC (int ) PyTuple_ClearFreeList (void );
38+
6939#ifndef Py_LIMITED_API
70- PyAPI_FUNC (void ) _PyTuple_DebugMallocStats (FILE * out );
71- #endif /* Py_LIMITED_API */
40+ # define Py_CPYTHON_TUPLEOBJECT_H
41+ # include "cpython/tupleobject.h"
42+ # undef Py_CPYTHON_TUPLEOBJECT_H
43+ #endif
7244
7345#ifdef __cplusplus
7446}
0 commit comments