Class property inheritance when property is another class' property in python
<p>I have a class:</p>

<pre><code>class a():
    def __init__(self):
        self.x = ["a", "b"]
</code></pre>

<p>and another class:</p>

<pre><code>class b():
    def __init__(self, r):
        self.y = r
    def chg(self, a):
        self.y = a
</code></pre>

<p>I do:</p>

<pre><code>&gt;&gt;&gt; m = a()
&gt;&gt;&gt; m.x
["a", "b"]
&gt;&gt;&gt; n = b(m.x)
&gt;&gt;&gt; n.y
["a", "b"]
&gt;&gt;&gt; n.y = ["c", "d"]
&gt;&gt;&gt; n.y
["c", "d"]
&gt;&gt;&gt; m.x
["a", "b"]
</code></pre>

<p>Now why didn't <code>m.x</code> change to <code>["c", "d"]</code>? How can I achieve this?</p>