Mercurial > repos > rliterman > csp2
annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/python3.8/cpython/tupleobject.h @ 69:33d812a61356
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 17:55:14 -0400 |
parents | |
children |
rev | line source |
---|---|
jpayne@69 | 1 #ifndef Py_CPYTHON_TUPLEOBJECT_H |
jpayne@69 | 2 # error "this header file must not be included directly" |
jpayne@69 | 3 #endif |
jpayne@69 | 4 |
jpayne@69 | 5 #ifdef __cplusplus |
jpayne@69 | 6 extern "C" { |
jpayne@69 | 7 #endif |
jpayne@69 | 8 |
jpayne@69 | 9 typedef struct { |
jpayne@69 | 10 PyObject_VAR_HEAD |
jpayne@69 | 11 /* ob_item contains space for 'ob_size' elements. |
jpayne@69 | 12 Items must normally not be NULL, except during construction when |
jpayne@69 | 13 the tuple is not yet visible outside the function that builds it. */ |
jpayne@69 | 14 PyObject *ob_item[1]; |
jpayne@69 | 15 } PyTupleObject; |
jpayne@69 | 16 |
jpayne@69 | 17 PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t); |
jpayne@69 | 18 PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *); |
jpayne@69 | 19 |
jpayne@69 | 20 /* Macros trading safety for speed */ |
jpayne@69 | 21 |
jpayne@69 | 22 /* Cast argument to PyTupleObject* type. */ |
jpayne@69 | 23 #define _PyTuple_CAST(op) (assert(PyTuple_Check(op)), (PyTupleObject *)(op)) |
jpayne@69 | 24 |
jpayne@69 | 25 #define PyTuple_GET_SIZE(op) Py_SIZE(_PyTuple_CAST(op)) |
jpayne@69 | 26 |
jpayne@69 | 27 #define PyTuple_GET_ITEM(op, i) (_PyTuple_CAST(op)->ob_item[i]) |
jpayne@69 | 28 |
jpayne@69 | 29 /* Macro, *only* to be used to fill in brand new tuples */ |
jpayne@69 | 30 #define PyTuple_SET_ITEM(op, i, v) (_PyTuple_CAST(op)->ob_item[i] = v) |
jpayne@69 | 31 |
jpayne@69 | 32 PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out); |
jpayne@69 | 33 |
jpayne@69 | 34 #ifdef __cplusplus |
jpayne@69 | 35 } |
jpayne@69 | 36 #endif |