#20135: FAQ entry for list mutation. (See also 6375bf34fff6.)

I accidentally committed this in 6375bf34fff6; this changeset addresses the
last review comments on the patch.

This is a perennial question and something someone opens a ticket for probably
every other month or so, so I'm surprised we didn't already have a FAQ entry
for it.

The original patch was written by M. Votz, refined first by Ezio Melotti and
further refined by me.
This commit is contained in:
R David Murray 2014-09-29 10:17:28 -04:00
parent c31f12d196
commit 12dc0d96e0

View file

@ -473,7 +473,7 @@ There are two factors that produce this result:
After the call to :meth:`~list.append`, the content of the mutable object has
changed from ``[]`` to ``[10]``. Since both the variables refer to the same
object, accessing either one of them accesses the modified value ``[10]``.
object, using either name accesses the modified value ``[10]``.
If we instead assign an immutable object to ``x``::