2019-06-03 python copy depth

Python built modifiable collection class objects, such as lists, dictionaries, collections, etc., may be used directly copy the corresponding factory methods.

Shallow copy means create a new object, but sub-objects corresponding to the original object of its children still pointing. In other words, this will copy the original object layer, without recursive sub-objects are also copied.

Deep copy will recursively copy child objects.

 

Assignment

 

Latent copy

 

Deep Copy

 

Guess you like

Origin www.cnblogs.com/reclusive/p/10965412.html