Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 12dc0d9

Browse files
committed
#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.
1 parent c31f12d commit 12dc0d9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Doc/faq/programming.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ There are two factors that produce this result:
473473

474474
After the call to :meth:`~list.append`, the content of the mutable object has
475475
changed from ``[]`` to ``[10]``. Since both the variables refer to the same
476-
object, accessing either one of them accesses the modified value ``[10]``.
476+
object, using either name accesses the modified value ``[10]``.
477477

478478
If we instead assign an immutable object to ``x``::
479479

0 commit comments

Comments
 (0)