title: Default parameters in Python
body: <p>I have class hierarchy as follows:</p>
  
  <pre><code>class ContextSummary(object):
      def __init__(self, id, db):
          self.db = db
          self.id = id
  
  class GroupContextSummary(ContextSummary):
      def __init__(self, gId, db = {}):
          super(GroupContextSummary, self).__init__(gId, db)
  </code></pre>
  
  <p>I use <code>GroupContextSummary</code> class without the 2nd parameter multiple times in unittest.</p>
  
  <pre><code>groupSummary = GroupContextSummary(gId)
  </code></pre>
  
  <p>The issue is that the db still keeps the previous run values. In order to prevent this, I had to use </p>
  
  <pre><code>groupSummary = GroupContextSummary(gId, {})
  </code></pre>
  
  <p>Or I had to redefine the init method as</p>
  
  <pre><code>def __init__(self, gId, db = None):
      if db is None: db = {}
      super(GroupContextSummary, self).__init__(gId, db)
  </code></pre>
  
  <p>What might be wrong?</p>