x = Object1
b = Object2
What is the difference between
import copy
x = b
x = copy.copy(b)
x = Object1
b = Object2
What is the difference between
import copy
x = b
x = copy.copy(b)
Assignment statements in Python do not copy objects, they create bindings between a target and an object copy doc @python.org
Thus if you really want to have the same object twice without any bindings between you can use the copy package.