I just saw some code that says data = copy.deepcopy(data)
.
It will allocate new memory for the data. Try run this snippet code
import copy
data = [1, 2, 3, 4]
print(hex(id(data)))
data = copy.deepcopy(data)
print(hex(id(data)))
Different memory address will be printed.