title: Update dynamically dependent object attributes after mutation
body: <p>Let's take as example <a href="https://stackoverflow.com/a/14916491/3891053">this classical solution</a> to the problem of updating dependent object attributes:</p>
  <pre><code>class SomeClass(object):
      def __init__(self, n):
          self.list = range(0, n)
  
      @property
      def list(self):
          return self._list
      @list.setter
      def list(self, val):
          self._list = val
          self._listsquare = [x**2 for x in self._list ]
  
      @property
      def listsquare(self):
          return self._listsquare
      @listsquare.setter
      def listsquare(self, val):
          self.list = [int(pow(x, 0.5)) for x in val]
  </code></pre>
  <p>It works as required: when a new value is set for one attribute, the other attribute is updated:</p>
  <pre><code>&gt;&gt;&gt; c = SomeClass(5)
  &gt;&gt;&gt; c.listsquare
  [0, 1, 4, 9, 16]
  &gt;&gt;&gt; c.list
  [0, 1, 2, 3, 4]
  &gt;&gt;&gt; c.list = range(0,6)
  &gt;&gt;&gt; c.list
  [0, 1, 2, 3, 4, 5]
  &gt;&gt;&gt; c.listsquare
  [0, 1, 4, 9, 16, 25]
  &gt;&gt;&gt; c.listsquare = [x**2 for x in range(0,10)]
  &gt;&gt;&gt; c.list
  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  </code></pre>
  <p>But, what if we mutate the attribute <code>list</code> instead of setting it to a new value?:</p>
  <pre><code>&gt;&gt;&gt; c.list[0] = 10
  &gt;&gt;&gt; c.list
  [10, 1, 2, 3, 4, 5, 6, 7, 8, 9]  # this is ok
  &gt;&gt;&gt; c.listsquare
  [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]  # we would like 100 as first element
  </code></pre>
  <p>We would like <code>listsquare</code> attribute to be updated accordingly, but it's not the case because the setters are not invoked when we mutate the <code>list</code> attribute.</p>
  <p>Of course we could force the update by explicitly invoking the setter after we modify the attribute, for example by doing:</p>
  <pre><code>&gt;&gt;&gt; c.list[0] = 10
  &gt;&gt;&gt; c.list = c.list. # invoke setter
  &gt;&gt;&gt; c.listsquare
  [100, 1, 4, 9, 16, 25, 36, 49, 64, 81]
  </code></pre>
  <p>but it looks somewhat cumbersome and error prone for the user, we would prefer that it occurs implicitly.</p>
  <p>What would be the most pythonic way for having the attributes updated when another <strong>mutable</strong> attribute is modified. How the object can know that one of his attributes has been modified?</p>