[issue6219] nested list value change

2009-06-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: This is correct behavior. Try making a new *copy* of the sublist: a = [[1,2],[3,4],[5,6]] b = a[0][:] b[0] = - -- nosy: +rhettinger resolution: -> invalid status: open -> closed ___ Python tracker

[issue6219] nested list value change

2009-06-06 Thread Pushkar Paranjpe
New submission from Pushkar Paranjpe : Is this a bug ? >>> a = [[1,2],[3,4],[5,6]] >>> a [[1, 2], [3, 4], [5, 6]] >>> b = a[0] >>> b [1, 2] >>> b[0] = - >>> b [-, 2] >>> a [[-, 2], [3, 4], [5, 6]] >>> Created a new variable (b) which refers to an element in a list (a). Changing the