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 antoine Zellmeyer
Recipients antoine Zellmeyer, ned.deily, ronaldoussoren, terry.reedy
Date 2016-08-02.12:09:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1470139758.94.0.42567832187.issue27668@psf.upfronthosting.co.za>
In-reply-to
Content
>>> tab = [['x']*3]*3
>>> tab
[['x', 'x', 'x'], ['x', 'x', 'x'], ['x', 'x', 'x']]
>>> tab[1][0] = 5
>>> tab
[[5, 'x', 'x'], [5, 'x', 'x'], [5, 'x', 'x']]
>>> 

why not only the element tab[1][0] is changed ?
History
Date User Action Args
2016-08-02 12:09:19antoine Zellmeyersetrecipients: + antoine Zellmeyer, terry.reedy, ronaldoussoren, ned.deily
2016-08-02 12:09:18antoine Zellmeyersetmessageid: <1470139758.94.0.42567832187.issue27668@psf.upfronthosting.co.za>
2016-08-02 12:09:18antoine Zellmeyerlinkissue27668 messages
2016-08-02 12:09:18antoine Zellmeyercreate