Size of tuples
Brian Quinlan
BrianQ at ActiveState.com
Wed Sep 5 15:43:47 EDT 2001
Ignacio Vazquez-Abrams wrote:
> > Using a list to store a large number of integers would probably be
> > more convenient though since it doesn't require making a new
object
> > for each append. Anyway:
>
> Of course not. Tuples _can't_ append; they're immutable.
Sometime the whole story is too painful:
...since it doesn't require that the variable bound to the tuple be
rebound to a newly created tuple, which is the product of the
currently bound tuple and the one that you are adding, each time that
you wish the variable bound to the tuple to refer to a new tuple that
contains the additional elements that you wish.
Or something like that.
Cheers,
Brian
More information about the Python-list
mailing list