Mark Dickinson <dicki...@gmail.com> added the comment:

This isn't a bug. After this line in your code:

   o = x

both o and x refer to the same list object. So any modification you make to 
that list through the name "x" (for example, x[i][n]+=y[i][n]) will be seen 
through the name "o" as well.

There's lots written elsewhere explaining Python's assignment semantics. I 
highly recommend this presentation by Ned Batchelder: 
https://nedbatchelder.com/text/names1.html

You can also ask further questions on the Python mailing list: 
https://mail.python.org/mailman/listinfo/python-list

Closing here.

----------
nosy: +mark.dickinson
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39118>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to