title: Share attributes/ variables between classes python
body: <pre class="lang-py prettyprint-override"><code>class Base(object):
      def __init__(self):
          print(&quot;Base created&quot;)
          a = &quot;baseclass&quot;
  
  class ChildA(Base):
      def __init__(self):
          Base.__init__(self)
          b = &quot;child a&quot;
  
  class ChildB(Base):
      def __init__(self):
          super(ChildB, self).__init__()
          c = &quot;child b&quot;
          print(a)
          print(b)
  
  ChildA()
  ChildB()
  </code></pre>
  <pre><code>NameError: name 'a' is not defined
  </code></pre>