This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients Abraham.Smith, docs@python, georg.brandl, martin.panter, matheus.v.portela, r.david.murray, steven.daprano
Date 2015-09-04.14:23:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1441376593.04.0.101670870642.issue23406@psf.upfronthosting.co.za>
In-reply-to
Content
What is actually happening is that the *contents* of the list are copied, but the list itself is not.  This is a consequence of the definition in terms of +.  So, yes, that is a shallow copy, but not quite in the sense that mylist.copy() is a shallow copy, since the references to the contents of s get appended to the list being constructed by *, not a new list that is a "copy" of s.

You are correct that "s is only referenced" is not really accurate.  But how about "Note that the contents of the *s* object are not copied, they are referenced multiple times".  I think that highlights the source of the confusion: that the *contents* are not copied.
History
Date User Action Args
2015-09-04 14:23:13r.david.murraysetrecipients: + r.david.murray, georg.brandl, steven.daprano, docs@python, martin.panter, matheus.v.portela, Abraham.Smith
2015-09-04 14:23:13r.david.murraysetmessageid: <1441376593.04.0.101670870642.issue23406@psf.upfronthosting.co.za>
2015-09-04 14:23:13r.david.murraylinkissue23406 messages
2015-09-04 14:23:12r.david.murraycreate