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 dechamps
Recipients dechamps
Date 2015-07-08.08:01:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1436342476.49.0.0477320151656.issue24589@psf.upfronthosting.co.za>
In-reply-to
Content
After creating a list of lists, changing one element, leads to changes of all the elements:

>>> v=[[]]*10
>>> v
[[], [], [], [], [], [], [], [], [], []]
>>> v[3].append(3)
>>> v
[[3], [3], [3], [3], [3], [3], [3], [3], [3], [3]]
>>> 
>>> v=[[]]*10
>>> v
[[], [], [], [], [], [], [], [], [], []]
>>> v[3] += [3]
>>> v
[[3], [3], [3], [3], [3], [3], [3], [3], [3], [3]]
>>>
History
Date User Action Args
2015-07-08 08:01:16dechampssetrecipients: + dechamps
2015-07-08 08:01:16dechampssetmessageid: <1436342476.49.0.0477320151656.issue24589@psf.upfronthosting.co.za>
2015-07-08 08:01:16dechampslinkissue24589 messages
2015-07-08 08:01:16dechampscreate