[issue7917] list of list created by *

2010-02-12 Thread Florent Xicluna
Changes by Florent Xicluna : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue7917] list of list created by *

2010-02-12 Thread Florent Xicluna
Florent Xicluna added the comment: It is by design. Please read the documentation: http://docs.python.org/library/stdtypes.html#sequence-types-str-unicode-list-tuple-buffer-xrange -- nosy: +flox resolution: -> invalid ___ Python tracker

[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 [[], [], [], []] >>> data[0] += [(0,1)] >>> print data [[(0, 1)], [], [], []] -- ___ Pyth

[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 to all the lists in the global list. ---

[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 ___