Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:

This is not a bug. No copy is made at all, neither shallow nor deep.

This is described in the documentation for built-in types:

https://docs.python.org/3/library/stdtypes.html#common-sequence-operations

and is similar to the issue in the FAQs:

https://docs.python.org/3/faq/programming.html#id16


I acknowledge that this is sometimes confusing for beginners, but it is just 
one of those things that programmers have to learn. Sequence multiplication 
does not copy the items, it replicates references to the same item.

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

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

Reply via email to