On Thu, 31 Dec 2009 08:13:35 -0800 (PST) davidj411
<davidj...@gmail.com> wrote:

> I am not sure why this behavior is this way.
> at beginning of script, i want to create a bunch of empty lists and
> use each one for its own purpose.
> however, updating one list seems to update the others.
> 
> >>> a = b = c = []
No, you're only creating one list (and giving that one list three
names). Creating three lists would be:

a = []
b = []
c = []

or, alternatively

a, b, c = [], [], []

Just remember: Python "variables" are just names that point to the
actual data. "x = y" just means "make 'x' a synonym for 'y'".

/W


-- 
INVALID? DE!

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to