Ezio Melotti <ezio.melo...@gmail.com> added the comment:

That's because with [{}] * 3 you get a list with 3 copies of the same object, 
so all the elements in c refer to the same dict:
>>> a = [{}, {}, {}]
>>> b = [{}] + [{}] + [{}]
>>> c = [{}] * 3
>>> map(id, a)
[12850496, 12850784, 12850928]
>>> map(id, b)
[12851648, 12851072, 12851792]
>>> map(id, c)
[12852080, 12852080, 12852080]

----------
nosy: +ezio.melotti
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

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

Reply via email to