title: Python - Accessing parent members
body: <p>I'm facing a standstill here while trying to figure out how to have member classes access data from their parent when they are part of an external module.</p>
  
  <p>Basically, this works (the B class can access is parent's methods like so:  A.say_hi(A) ):</p>
  
  <pre><code>class A:
      def __init__(self):
          print("Initializing parent object...")
          self.child = self.B()
  
      class B:
          def __init__(self):
              print("Initializing child...")
              A.say_hi(A)
  
      def say_hi(self):
          print("A class says hi")
  </code></pre>
  
  <p>However, this can get pretty messy if classes start getting extra large, so I have been placing my additional classes in files and importing them inline. The problem with that is I can no longer get the member class to access its parent's members and functions if I try to use 'import B.py' when class B is defined within.</p>
  
  <p>Is there any way to get the original behavior without leaving the member class inside the same file as the parent?</p>