Inserts a reference to object o at position pos of
the tuple pointed to by p. It returns 0 on success.
Note: This function ``steals'' a reference to o.
Does the same, but does no error checking, and
should only be used to fill in brand new tuples.
Note: This function ``steals'' a reference to o.
int _PyTuple_Resize (PyTupleObject *p,
int newsize, int last_is_sticky)
Can be used to resize a tuple. newsize will be the new length
of the tuple. Because tuples are supposed to be immutable,
this should only be used if there is only one reference to 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 true, 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. Returns 0 on
success and -1 on failure (in which case a
MemoryError or SystemError will be raised).