title: How To Copy All Properties of Class Instance To New Instance
body: <p>How would I copy all the properties of a class to a new instance of the class.
  In the example below, with the way python works, when I use b=a, it assigns b and a to the same memory address. When i make a change to "b" the change is also made to "a."
  <a href="https://i.stack.imgur.com/nhKq8.png" rel="nofollow noreferrer">Both elements of the list are stored at the same address</a></p>
  
  <pre><code>class test:
  
      def __init__(self, name="Name",data=[]):
          self.name=name
          self.data=data
  
  
  
  
  list=[]
  a = test("First Name",["DATA1","DATA2","DATA3"])
  b=a
  list.append(a)
  list.append(b) 
  </code></pre>
  
  <p>I'm wanting to achieve something similar to how the list class allows you to do this to copy the list to a new memory address.</p>
  
  <pre><code>list1=[1,2,3]
  list2=list(list1)
  </code></pre>
  
  <p>So in my case.</p>
  
  <pre><code>a = test("First Name",["DATA1","DATA2","DATA3"])
  b=test(a)
  </code></pre>
  
  <p>without having to </p>
  
  <pre><code>b=test(a.name,a.data)
  </code></pre>
  
  <p><em>EDIT</em> </p>
  
  <p>Id like to achive the same effect as </p>
  
  <pre><code> b=copy.deepcopy(a)
  </code></pre>
  
  <p>but through this usage.</p>
  
  <pre><code>b=test(a)
  </code></pre>