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