Automatically readdress all variables referring to an object
<p>Suppose I have in python this object</p>

<pre><code>class Foo:  
    def __init__(self, val):
        self.val = val
</code></pre>

<p>and these two variables</p>

<pre><code>a=Foo(5)
b=a
</code></pre>

<p>both <code>b</code> and <code>a</code> refer to the same instance of <code>Foo()</code>, so any modification to the attribute <code>.val</code> will be seen equally and synchronized as <code>a.val</code> and <code>b.val</code>. </p>

<pre><code>&gt;&gt;&gt; b.val
5
&gt;&gt;&gt; b.val=3
&gt;&gt;&gt; a.val
3
</code></pre>

<p>Now suppose I want to say <code>a=Foo(7)</code>. This will create another instance of Foo, so now <code>a</code> and <code>b</code> are independent.</p>

<p>My question is: is there a way to have <code>b</code> readdressed automatically to the new Foo() instance, without using an intermediate proxy object? It's clearly not possible with the method I presented, but maybe there's some magic I am not aware of. </p>
