Track changes of atributes in instance. Python
<p>I want to implement function which takes as argument any object and trackes changes of value for specific attribute. Than saves old value of attribute in old_name attribute.</p>

<p>For example:</p>

<pre><code>class MyObject(object):
     attr_one = None
     attr_two = 1
</code></pre>

<p>Lets name my magic function <code>magic_function()</code></p>

<p>Sot than i can do like this:</p>

<pre><code>obj = MyObject()
obj = magic_function(obj)
obj.attr_one = 'new value'
obj.attr_two = 2
</code></pre>

<p>and it saves old values so i can get like this</p>

<pre><code>print obj.old_attr_one
None
print obj.attr_one 'new value'
</code></pre>

<p>and </p>

<pre><code>print obj.old_attr_two
1
print obj.attr_two
2
</code></pre>

<p>Something like this.. I wonder how can i do this by not touching the class of instance?</p>
