whats the difference between shallow and deep copying ? i read on python docs (http://docs.python.org/2/library/copy.html). it basically said shallow copying makes references while deep copying actually copies. so i created a list through shallow copying and changed its values.but the changes werent reflected in the original list.how is that so if shallow copying works on references? (just for the record ,I am using python 2.7.5)
>>>li = [1,2,3,4]
>>> x = copy(li)
>>> x
[1, 2, 3, 4]
>>> x[0]=9
>>> x
[9, 2, 3, 4]
>>> li
[1, 2, 3, 4]