KraftDiner wrote: > I understand that everything in python is a refrence.... > > I have a small problem.. > > I have a list and want to make a copy of it and add an element to the > end of the new list, > but keep the original intact.... > > so: > tmp = myList >
tmp = myList is a shallow copy > tmp.append(something) > print tmp, myList > > should be different... > Therefore it shouldn't be different. What you could do is make a second list tmp = [] And then use the extend method: tmp.extend(myList) tmp.append(someEntry) This would give you what you want, and there's more than one way to do this. -carl -- Carl J. Van Arsdall [EMAIL PROTECTED] Build and Release MontaVista Software -- http://mail.python.org/mailman/listinfo/python-list