title: Copy object in Python?
body: <p>I'm new to Python, so I tried writing a class to emulate string functions in C:</p>
  
  <pre><code>class CString:
  
    def __init__(self,str):
          self.value=[]
          self.value.extend(list(str))
  
  def strcpy(cstring1,cstring2):
        import copy
        cstring1=copy.copy(cstring2)
  
  def puts(cstring1):
      print ''.join(cstring1.value)
  </code></pre>
  
  <p>But strcpy doesn't seem to be working:</p>
  
  <pre><code>&gt;&gt;obj1=CString("Hello World")
  &gt;&gt;obj2=CString("Hai World!")
  &gt;&gt;puts(obj1)
  Hello World!
  &gt;&gt;puts(obj2)
  Hai World!
  &gt;&gt;strcpy(obj1,obj2)
  &gt;&gt;puts(obj1)
  Hello World!
  </code></pre>
  
  <p>Am I assigning copy.copy(cstring2) wrongly?</p>