title: Python: copying objects with copy.deepcopy or writing my own copy
body: <p>Currently I am using the copy module to create a copy of some object that I have.</p>
  
  <p>Under certain conditions (that occur frequently), I will need to create possibly several copies of the original object, and then modify each of them individually (hence why I am using copy).</p>
  
  <p>The object has several instances of various datatypes (lists, ints, strings, other classes), and the copies need to have the same values, but I am not sure whether it would faster to call copy.deepcopy(), or do something like</p>
  
  <pre>
  def copy(self, other):
     other.prop1 = self.prop1
     other.prop2 = self.prop2
     other.prop3 = self.prop3
  </pre>
  
  <p>Has anyone run into this problem and then decided it was better to use the copy module because it would be faster than anything most people could come up with?</p>
  
  <p>PS: the code above wouldn't properly copy mutable objects and those "other classes" that I mentioned. Perhaps that suggests deepcopy is the safest (and fastest) route?</p>