Are tuple really immutable?

Alex Martelli aleaxit at yahoo.com
Mon Dec 27 05:03:03 EST 2004


Chris <chris.monnet at gmail.com> wrote:
   ...
> 3) In this example, is t considered mutable or not?
> "Tuple are immutable" says the doc, but:
> >>> t[0].append(0)
> >>> t
> ([1, 0], [2])
> 
> The tuple is immutable but its elements can be mutable: I tend to think
> that it means that the tuple is mutable. Indeed, it changed!

Maybe the last page of
<http://mail.python.org/pipermail/python-list/2002-April/099227.html>
can help with this conceptual issue.


Alex



More information about the Python-list mailing list