Shallow copy vs deep copy
A shallow copy copies the outer container; a deep copy recursively copies nested objects too.
- Shallow shares nested refs
- Deep duplicates nested refs
- copy and deepcopy from copy module
Shallow copy vs deep copy
A shallow copy copies the outer container; a deep copy recursively copies nested objects too.
A shallow copy copies the outer container; a deep copy recursively copies nested objects too.
Shallow copy vs deep copy