summaryrefslogtreecommitdiffstats
path: root/Include/tupleobject.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-03-09 12:10:16 (GMT)
committerGuido van Rossum <guido@python.org>1995-03-09 12:10:16 (GMT)
commit599de5ab9f922d4fa2c5557d0951ddc1e61f2fdf (patch)
tree6d34fe8f830bcc78080931b0c84c0b997ce3de2e /Include/tupleobject.h
parent65bc7a7bf209c1c33ed13240f7bdd294d23a6257 (diff)
downloadcpython-599de5ab9f922d4fa2c5557d0951ddc1e61f2fdf.zip
cpython-599de5ab9f922d4fa2c5557d0951ddc1e61f2fdf.tar.gz
cpython-599de5ab9f922d4fa2c5557d0951ddc1e61f2fdf.tar.bz2
addet SETTUPLEITEM and added cast to GETTUPLEITEM
Diffstat (limited to 'Include/tupleobject.h')
-rw-r--r--Include/tupleobject.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Include/tupleobject.h b/Include/tupleobject.h
index da76891..992c770 100644
--- a/Include/tupleobject.h
+++ b/Include/tupleobject.h
@@ -61,7 +61,10 @@ extern PyObject *PyTuple_GetSlice Py_PROTO((PyObject *, int, int));
extern int _PyTuple_Resize Py_PROTO((PyObject **, int, int));
/* Macro, trading safety for speed */
-#define PyTuple_GET_ITEM(op, i) ((op)->ob_item[i])
+#define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i])
+
+/* Macro, *only* to be used to fill in brand new tuples */
+#define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
#ifdef __cplusplus
}