[issue15416] 3 * [] gives a list of 3 cross-referenced lists, a[1]='blah' writes in to ALL three!

Amaury Forgeot d'Arc report at bugs.python.org
Sun Jul 22 00:12:48 CEST 2012


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

The * operator does not create copies, it duplicates references to existing objects.
Please read: http://docs.python.org/faq/programming.html#how-do-i-create-a-multidimensional-list

----------
nosy: +amaury.forgeotdarc
resolution:  -> invalid
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15416>
_______________________________________


More information about the Python-bugs-list mailing list