Reference Copy and Deep Copy in Python
Learn the difference between both types of copy
Beware of copies in Python. Here are two types.
Know the difference and which one to choose.
Python offers reference copy and deep copy.
But what’s the difference?
In reference “copy” or simple assignment, an object is created — let’s call it obj2. That “copy” will only create a reference to the original object1 — obj1. This way, any changes made to obj1 will be reflected in obj2 (e.g. change a value or create a new…