On 2006-10-30, SpreadTooThin <[EMAIL PROTECTED]> wrote: > def fn(list): > list[1] = 0 > > myList = [1, 2, 3] > print myList > fn(myList) > print myList > >>>> [1,2,3] >>>> [1,0,3] > > How can I avoid this? In this case this is a really simplified > example but the effects are the same... How do I specify or > create deep copies of objects that may contain other objects > that may contain other object that may contain other > objects....
See 3.18 Copy -- Shallow and deep copy operations. -- Neil Cerutti I pulled into a lay-by with smoke coming from under the bonnet. I realized the car was on fire so took my dog and smothered it with a blanket. --Insurance Claim Blooper -- http://mail.python.org/mailman/listinfo/python-list