title: Chained Python class invocations
body: <p>I am trying to build a set of classes to define hierarchical properties for protocols in the OSI stack... in an abstract sense, I just need to inherit properties from parent python classes, but I need to be able to invoke the entire class chain at once... so, I'm looking for something like this...</p>
  
  <pre><code>#!/usr/bin/env python
  
  class Foo(object):
      def __init__(self,fooprop1=None):
          return None
  class Bar(Foo):
      def __init__(self,barprop1=None):
          return None
  
  if __name__=='__main__':
      tryit = Foo(fooprop1="someMacAddress").Bar(barprop1="someIpAddress")
  </code></pre>
  
  <p>However, invoking that script complains that <code>AttributeError: 'Foo' object has no attribute 'Bar'</code></p>
  
  <p>Can someone show me a way to get this done in python?  Thanks in advance...</p>