title: How may I edit a class attribut
body: <p>I was wondering how I can make all instances inherited from dataObj (Two and One) modify the <code>.data</code> attribute of <code>self.buffer</code>:</p>
  
  <p>When I modify the .data of the instance of one or two, I want this to change the .data of the buffer instance.</p>
  
  <p>In order word, how can I make <code>.data</code> become global for all instance of <code>dataObj</code> so when I change <code>.data</code> in one of the instance it apply changes for all of them.</p>
  
  <pre><code>class dataObj():
  
  def __init__(self, data):
      self.data = data
  
  def read(self, width):
      self.data = self.data[width:]
  
  
  class One(dataObj):
      def __init__(self, data):
          self.data = data
  
      def deserialize(self):
          self.read(1)
  
  
  class Two(dataObj):
      def __init__(self, data):
          self.data = data
  
      def deserialize(self):
          self.read(2)
  
  
  class msg():
      def __init__(self):
          self.buffer = dataObj('0123456789')
  
      def run(self):
          print("buffer.data = ", self.buffer.data)
  
          one = One(self.buffer.data)
          one.deserialize()
          print("one.data = ",one.data)
  
          two = Two(self.buffer.data)
          two.deserialize()
          print("two.data = ", two.data)
  
          print("buffer.data = ", self.buffer.data)
  
  
  main = msg()
  main.run()
  </code></pre>
  
  <p>The output:</p>
  
  <pre><code>buffer.data =  0123456789
  one.data =  123456789
  two.data =  23456789
  buffer.data =  0123456789
  </code></pre>
  
  <p>The output I want:</p>
  
  <pre><code>buffer.data =  0123456789
  one.data =  123456789
  two.data =  3456789
  buffer.data =  3456789
  </code></pre>
  
  <p>I have to think of using a class attribute
  something like this:</p>
  
  <pre><code>class dataObj():
  
      data = '0123456789'
      def __init__(self, data):
          pass
  </code></pre>
  
  <p>But I dont know how i may modify this class attribute.</p>