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.

classification
Title: unintended changes occur when dealing with list of list
Type: behavior Stage: resolved
Components: Demos and Tools Versions: Python 3.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Zhihan Chen, eryksun, steven.daprano
Priority: normal Keywords:

Created on 2016-07-06 00:07 by Zhihan Chen, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Screenshot from 2016-07-05 16-44-14.png Zhihan Chen, 2016-07-06 00:07
Messages (4)
msg269858 - (view) Author: Zhihan Chen (Zhihan Chen) Date: 2016-07-06 00:07
When creating list of list with multiplication, changing one element of a list will result in changing all lists.
msg269860 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2016-07-06 00:14
This is by design. Please read the answer for the frequently asked question "How do I create a multidimensional list?":

https://docs.python.org/3/faq/programming.html#how-do-i-create-a-multidimensional-list
msg269861 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2016-07-06 01:09
Hi Zhihan Chen, I see this issue is closed, but for future reference please don't post screenshots to report issues unless they are really needed. For text output, just copy the text from your terminal and paste it into your bug report. Making a screen shot is more work for you, less useful for us, and makes it impossible for the blind and visually impaired to read it using a screen-reader.
msg269866 - (view) Author: Zhihan Chen (Zhihan Chen) Date: 2016-07-06 01:57
Oh I am really sorry for my carelessness. Please accept my apology. and thank you Steven, I will pay special attention to that.
History
Date User Action Args
2022-04-11 14:58:33adminsetgithub: 71646
2016-07-06 01:57:12Zhihan Chensetmessages: + msg269866
2016-07-06 01:09:41steven.dapranosetnosy: + steven.daprano
messages: + msg269861
2016-07-06 00:14:53eryksunsetstatus: open -> closed

nosy: + eryksun
messages: + msg269860

resolution: not a bug
stage: resolved
2016-07-06 00:08:18Zhihan Chensettitle: unintended changes occurs when dealing with list of list -> unintended changes occur when dealing with list of list
2016-07-06 00:07:52Zhihan Chencreate