[issue7917] list of list created by *

2010-02-12 Thread Andrew Chong
Changes by Andrew Chong : -- nosy: sledge76 severity: normal status: open title: list of list created by * versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue7

[issue7917] list of list created by *

2010-02-12 Thread Andrew Chong
New submission from Andrew Chong : 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

[issue7917] list of list created by *

2010-02-12 Thread Andrew Chong
Andrew Chong added the comment: But this works fine. >>> data = [] >>> data += [[]] >>> data += [[]] >>> data += [[]] >>> data += [[]] >>> print data [[], [], [], []]