title: Python object composition - accessing a method from the class that called it
body: <p>You'll have to forgive me, I am trying to teach myself OO but I have come across this problem with composition and 'has-a' relationships.</p>
  
  <pre><code>class Main(object):
      def A(self):
          print 'Hello'
      def B(self):
          self.feature = DoSomething()
  
  class DoSomething(object):
      def ModifyMain(self):
          #Not sure what goes here... something like
          Main.A()
  
  def run():
      M = Main()
      M.B()
  </code></pre>
  
  <p>A real world example of the above simplification is a PySide application where Main is a MainWindow, and DoSomething is a dynamically created widget that is placed somewhere in the window. I would like DoSomething to be able to modify the status bar of the mainwindow, which is essentially calling (in Main) self.statusbar().</p>
  
  <p>If there is a shortcut in PySide to do this, Tops!! please let me know! However, I'm actually after the more general Pythonic way to do this. </p>
  
  <p>I think I'm close ... I just can't make it work...</p>