recent work has not made any progress, I can only say ExtJS a little bit big, hard to chew ~
In Python, it is often possible to move from one object to another to facilitate subsequent computations, which can be implemented using copies.
Generally speaking, the copy is divided into three kinds: 1. pointer reference, 2. Shallow copy, 3. Deep copy.
One, pointer reference
Objects in Python are assigned by reference, and if you need to copy objects, you need to use the Copy module in the standard library.
Second, shallow copy
Copy.copy a shallow copy copies only the parent object and does not copy the inner child objects of the object.
Third, deep copy
Copy.deepcopy a deep copy of a copy object and its child objects.
Iv. practice (at a glance)
Import copy
a = [1, 2, 3, 4, [' A ', ' B ']] #原始对象
b = A #赋值, the reference to the object
C = copy.copy (a) #对象拷贝, shallow copy
d = Copy.deepcopy (a) #对象拷贝, deep copy
a.append (5) #修改对象a
a[4].append (' C ') #修改对象a中的 [' A ', ' B '] Array object
print ' A = ', a #a = [1, 2, 3, 4, [' A ', ' B ', ' C '], 5]
print ' B = ', b #b = [1, 2, 3, 4, [' A ', ' B '], ' C '], 5]
print ' c = ', c #c = [1, 2, 3, 4, [' A ', ' B ', ' C ']]
print ' d = ', d #d = [1, 2, 3, 4, [' A ', ' B ']]