title: Allow object access to its owning object's attribute
body: <p>I've got a whole bunch of classes that are effectively algorithms, and they all inherit from a Mechanism class. I then have a MechanismStack class which holds a list of a bunch of these algorithm classes, they are all interchangeable/modular - i.e. output of Mechanism1.encode() goes into Mechanism2.encode() as the input etc. (effectively a queue of functions). </p>
  
  <p>A couple of these classes produce extra data than just the output. I want to store this extra data in the MechanismStack class (which is also an object - there are multiple different stacks comprised of different algorithms)</p>
  
  <pre><code>class MechanismStack:
      self.stack = [Mechanism1(), Mechanism2(), Mechanism3()]
      self.attribute = list()
      def encode(self, input):
          #process input through self.stack Mechanisms
  
  class Mechanism1(Mechanism):
      def function(self, input):
          #code
          owningMechanismStack.attribute = ['some', 'list']
  
  myStack = MechanismStack()
  myStack.encode('myInputString')
  </code></pre>