In <2349538.mvxudi8...@pointedears.de> Thomas 'PointedEars' Lahn 
<pointede...@web.de> writes:

> >> The obvious way does not work -
> >>
> >> a += (5, 6)
>                      ^^^^^^
> > Right, because a tuple is immutable.

> How did you get that idea?  It has been mutated in the very statement that 
> you are quoting

No.  An entirely new tuple is created, and 'a' is rebound to it.  The
existing tuple is not mutated.

-- 
John Gordon                   A is for Amy, who fell down the stairs
gor...@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to