[issue33636] Unexpected behavior with * and arrays

Steven D'Aprano report at bugs.python.org
Thu May 24 10:38:38 EDT 2018


Steven D'Aprano <steve+python at pearwood.info> added the comment:

This is not a bug, it is the documented behaviour: the * operator does not copy the lists, it duplicates references to the same list. There's even a FAQ for it:

https://docs.python.org/3/faq/programming.html#how-do-i-create-a-multidimensional-list

----------
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33636>
_______________________________________


More information about the Python-bugs-list mailing list