title: Python - how to correctly set up hierarchy of classes?
body: <p>I have the following code:</p>
  
  <pre><code>class Computer(object):
      def __init__(self, name):
          self.name = name
  
  class CPU(Computer):
      def __init__(self):
          super(CPU, self).__init__(name)
          self.name = name
  
  mycomputer = Computer('My Computer')
  mycomputer.CPU.name = 'Intel'
  
  print mycomputer.name, mycomputer.CPU.name
  </code></pre>
  
  <p>I would like to get the following:</p>
  
  <pre><code>My Computer, Intel
  </code></pre>
  
  <p>But I'm getting the following error:</p>
  
  <pre><code>AttributeError: 'Computer' object has no attribute 'CPU'    
  </code></pre>
  
  <p>How do I set up the class correctly, so once I run the main code, I would get what I need? I'm not even sure if I'm using super() correctly at all. </p>
  
  <p>I really appreciate all your help.</p>