This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sledge76
Recipients sledge76
Date 2010-02-12.14:52:31
SpamBayes Score 0.012896228
Marked as misclassified No
Message-id <1265986353.37.0.770575922393.issue7917@psf.upfronthosting.co.za>
In-reply-to
Content
This shows unexpected behavior.

>>> data2 = [[]] * 4
>>> print data2
[[], [], [], []]
>>> data2[0] += [(0,1)]
>>> print data2
[[(0, 1)], [(0, 1)], [(0, 1)], [(0, 1)]]

I added a tuple to only 0th list, but it got added to all the lists in the global list.
History
Date User Action Args
2010-02-12 14:52:33sledge76setrecipients: + sledge76
2010-02-12 14:52:33sledge76setmessageid: <1265986353.37.0.770575922393.issue7917@psf.upfronthosting.co.za>
2010-02-12 14:52:32sledge76linkissue7917 messages
2010-02-12 14:52:31sledge76create