blob: d22e6b974d767b7e4103400f9d3957acfae1b3b0 [file] [log] [blame]
Guido van Rossum85a5fbb1990-10-14 12:07:46 +00001/* Tuple object interface */
2
3/*
4123456789-123456789-123456789-123456789-123456789-123456789-123456789-12
5
6Another generally useful object type is an tuple of object pointers.
7This is a mutable type: the tuple items can be changed (but not their
8number). Out-of-range indices or non-tuple objects are ignored.
9
10*** WARNING *** settupleitem does not increment the new item's reference
11count, but does decrement the reference count of the item it replaces,
12if not nil. It does *decrement* the reference count if it is *not*
13inserted in the tuple. Similarly, gettupleitem does not increment the
14returned item's reference count.
15*/
16
17extern typeobject Tupletype;
18
19#define is_tupleobject(op) ((op)->ob_type == &Tupletype)
20
21extern object *newtupleobject PROTO((int size));
22extern int gettuplesize PROTO((object *));
23extern object *gettupleitem PROTO((object *, int));
24extern int settupleitem PROTO((object *, int, object *));