title: Recreate class object changing one constructor argument
body: <p>I'd like to have implement an <code>update</code> method in my class that recreates the class but changes just one constructor argument.</p>
  
  <p>My attempt:</p>
  
  <pre><code>class Updateable:
      def update(self, var, var_str, **kwargs):
          kwargs.update(self._vars)
          kwargs[var_str] = var
          self.__init__(**kwargs)
  
  class Rectangle(Updateable):
      def __init__(self, length, perimeter):
          self._vars = locals()
          self.length = length
          self.width = 0.5*(perimeter - 2.*length)      
  
  r = Rectangle(10, 20)
  r.update('perimeter', 16)
  </code></pre>
  
  <p>The problem is, the whole <code>locals()</code> thing, I think, is pretty dodgy, and it means that any class that is <code>Updateable</code> needs to assign <code>self._vars</code>.</p>
  
  <p>What would be the correct way to achieve this functionality?  Decorators, metaclasses?  Something simpler?</p>