[issue8081] a.append appends reference , causing unexpected behaviour

2010-03-06 Thread Benjamin Peterson
Benjamin Peterson added the comment: Sorry, this is the expected behavior. Copy the list if you want a different one. -- nosy: +benjamin.peterson resolution: -> invalid status: open -> closed ___ Python tracker __

[issue8081] a.append appends reference , causing unexpected behaviour

2010-03-06 Thread hamish farrant
New submission from hamish farrant : Causes modification of an list object to change the values of the object already inside the list. Example code : import random a =[] b = [1 , 2 , 3 , 4] for i in range (15): random.shuffle(b) a.append(b) for j in a: print j Expected Behaviour