## 12.2.2 Tuple Objects

`PyTupleObject`
  This subtype of `PyObject` represents a Python tuple object.

PyTypeObject `PyTuple_Type`
  This instance of `PyTypeObject` represents the Python tuple type.

int `PyTuple_Check`(PyObject *p)
  Return true if the argument is a tuple object.

PyTupleObject * `PyTuple_New`(int s)
  Return a new tuple object of size `s`

int `PyTuple_Size`(PyTupleObject *p)
  akes a pointer to a tuple object, and returns the size of that tuple.

PyObject * `PyTuple_GetItem`(PyTupleObject *p, int pos)
  returns the object at position `pos` in the tuple pointed to by `p`.

PyObject * `PyTuple_GET_ITEM`(PyTupleObject *p, int pos)
  does the same, but does no checking of it's arguments.

PyTupleObject * `PyTuple_GetSlice`(PyTupleObject *p, int low, int high)
  takes a slice of the tuple pointed to by `p` from `low` to `high` and returns it as a new tuple.

int `PyTuple_SetItem`(PyTupleObject *p, int pos, PyObject *o)
  inserts a reference to object `o` at position `pos` of the tuple pointed to by `p`. It returns 0 on success.

void `PyTuple_SET_ITEM`(PyTupleObject *p, int pos, PyObject *o)

  does the same, but does no error checking, and should only be used to fill in brand new tuples.

PyTupleObject * `_PyTuple_Resize`(PyTupleObject *p, int new, int last_is_sticky)
  can be used to resize a tuple. Because tuples are supposed to be immutable, this should only be used if there is only one module referencing the object. Do not use this if the tuple may already be known to some other part of the code. `last_is_sticky` is a flag - if set, the tuple will grow or shrink at the front, otherwise it will grow or shrink at the end. Think of this as destroying the old tuple and creating a new one, only more efficiently.