title: composition and aggregation in python
body: <p>I want to know how to implement composition and aggregation in <strong>UML terms</strong> in python. </p>
  
  <p>If I understood:</p>
  
  <ol>
  <li>Aggregation:</li>
  </ol>
  
  <p></p>
  
  <pre><code>class B:
      pass
  
  class A(object):
      def __init__(self):
          self.B = B
  </code></pre>
  
  <p></p>
  
  <ol start="2">
  <li>Composition:</li>
  </ol>
  
  <p>In other languages I saw this implemented as a pointer to B. I guess here <code>self.B</code> is a pointer in python. </p>
  
  <p></p>
  
  <pre><code>class A(object):
      def __init__(self, B):
          self.B = B
  </code></pre>
  
  <p></p>
  
  <p>Is it right?</p>