Returns the object at position pos in the tuple pointed
to by p. If pos is out of bounds, returns NULL and
sets an IndexError exception. Note: this
function returns a ``borrowed'' reference.
Does the same, but does no error checking, and
should only be used to fill in brand new tuples.
int _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.