creating new python objects seems to be the same object
<p>I have a problem with objects.</p>

<p>The following code</p>

<pre><code>class Data:
    def __init__(self,data=[]):
        self.data = data
    def add(self,data):
        self.data.extend(data)

class Parent:
    def testa(self):
        a = Data()
        a.add('a')
        print a.data
    def testb(self):
        b = Data()
        b.add('b')
        print b.data

if __name__ == "__main__":
    p = Parent()
    p.testa()
    p.testb()
</code></pre>

<p>Generates the following output:</p>

<pre><code>[]
['a']
['a']
['a', 'b']
</code></pre>

<p>Why is there not a new object created?  The second time in testb it seems that the old Data object still exists, although it was in a private variable.</p>

<p>How can I change the code so that a new object is created?</p>
