0
  x = Object1
  b = Object2

What is the difference between

 import copy

 x = b
 x = copy.copy(b)
Kevin
  • 1,103
  • 10
  • 33
  • 1
    `x = b` isn't a copy at all. – juanpa.arrivillaga Jan 15 '20 at 10:14
  • 2
    Does this answer your question? [What is the difference between shallow copy, deepcopy and normal assignment operation?](https://stackoverflow.com/questions/17246693/what-is-the-difference-between-shallow-copy-deepcopy-and-normal-assignment-oper) – Shibiraj Jan 15 '20 at 10:15

1 Answers1

0

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.

ZKDev
  • 315
  • 2
  • 9