Sandro Tosi <sandro.t...@gmail.com> added the comment:

Hi,
no it's not a bug :)

What you actually get with [[0]]*3 is a list of 3 references to the same list, 
[0]:

>>> a = [[0], [0], [0]]
>>> b = [[0]]*3
>>> for i in a: print(id(i))
... 
139807725184032
139807725300280
139807725300520
>>> for i in b: print(id(i))
... 
139807725324016
139807725324016
139807725324016

----------
nosy: +sandro.tosi
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

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

Reply via email to