title: Python Inheritance and __init__
body: <p>I'm learning Python and I've found something about how Python constructs a sub class which confuses me.</p>
  
  <p>I have a class that inherits from the list class as follows.</p>
  
  <pre><code>class foo(list):
      def __init__(self, a_bar):
          list.__init__([])
          self.bar = a_bar
  </code></pre>
  
  <p>I know that <code>list.__init__([])</code> needs to be there but I'm confused about it.  It seems to me that this line will just create a new list object and then assign it to nothing, so I would suspect that it would just get garbage collected.  How does Python know that this list is part of my object?  I suspect that there is something happening behind the scenes and I'd like to know what it is.</p>