Python classes - instances being overwritten?
<p>When calling on a new instance of an object for a class I've created, my one instance of the class is just being overwritten.  Why could this be?  Example is below.</p>

<p>My class is defined as follows:</p>

<pre><code>class my_class:
    attribute = ""
    examples = [] 
    children = []
    d = {}
    def __init__(self, attribute, e):
        self.attribute = attribute
        self.examples = e

        for ex in self.examples:
            self.d[ex[-1]] = self.d.get(ex[-1], 0) + 1
</code></pre>

<p>I am making an initial instance as such:</p>

<pre><code>root = my_class(some_attribute, data)
</code></pre>

<p>Then, I create another instance as such:</p>

<pre><code>child = my_class(different_attribute, root.examples[somewhere_1:somewhere_2])
</code></pre>

<p>In the end, my initial 'root' is now somehow identical to 'child', where 'root' should have gone unchanged.  Why is this!?</p>
