title: Overwirting an instance (overwrite/copy self) in python
body: <p>In the line after <strong>elif</strong> I assign the argument <strong>text</strong> to  <strong>self</strong>. A vain attempt to overwrite/copy the current instance.</p>
  
  <pre><code>class Someclass(object):
      def __init__(self, text):
          if type(text) == type(""):
              self._get_lines(text)
              self._parse_stats()
          elif type(text) == type(self):
              self = text
          else:
              raise TypeError()
  </code></pre>
  
  <p><strong>self</strong> is assigned, but only in the scope of <strong>init</strong>()</p>
  
  <p>Is it possible to copy an instance in this way (or similair), or do I need to go through and copy each instance variable to a new instance. Still how do I return it?</p>