title: requesting help making sub-class(es) access main class in python
body: <p>Hello I am looking for a way to make it so class A could have sub-class B and <code>self</code> in sub-class B points to A
  Example of what i am trying to do</p>
  <pre class="lang-py prettyprint-override"><code>class A:
      value = 'asdf'
      def __init__(self):
          self.B = self.B()
      
      class B:
          def printa(self):
              print(self.val)
  
  aa = A()
  aa.B.printa()
  </code></pre>
  <p>so in this example the function would print <code>asdf</code></p>