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 georg.brandl
Recipients Abraham.Smith, docs@python, georg.brandl
Date 2015-02-07.13:10:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1423314634.57.0.785233327604.issue23406@psf.upfronthosting.co.za>
In-reply-to
Content
There is no interning going on.  Multiplying lists just copies references.

This is not so surprising if you consider that the case may be simple for nested lists, but what about ``[a] * 3`` with some arbitrary object "a"?  Copying (or even deep copying) that object is usually not wanted, and impossible in general.

This is also documented here (see especially note 2 below the table):
https://docs.python.org/2/library/stdtypes.html#sequence-types-str-unicode-list-tuple-bytearray-buffer-xrange

You're right though that this might be good to mention in the tutorial, as it comes up every now and then.  I'll leave the issue open to discuss that.
History
Date User Action Args
2015-02-07 13:10:34georg.brandlsetrecipients: + georg.brandl, docs@python, Abraham.Smith
2015-02-07 13:10:34georg.brandlsetmessageid: <1423314634.57.0.785233327604.issue23406@psf.upfronthosting.co.za>
2015-02-07 13:10:34georg.brandllinkissue23406 messages
2015-02-07 13:10:34georg.brandlcreate