New submission from hamish farrant <farrant...@gmail.com>:

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 : the list referenced by b , should be appended to a , 
creating a list of random permutations of b.

----------
components: Interpreter Core
messages: 100548
nosy: hamish.farrant
severity: normal
status: open
title: a.append appends reference , causing unexpected behaviour
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8081>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to