title: defaultdict with default value 1?
body: <p>I am new to python, and i read some code snippet from some place. It's an implementation of counting sort.</p>
  
  <p>The code is as below:</p>
  
  <pre><code>from collections import defaultdict
  def sort_colors(A):
      ht = {}                        # a hash map
      ht = defaultdict(lambda:0, ht) # with default value 1
      for i in A:
           ht[i] += 1
      ret = []
      for k in [0, 1, 2]:
          ret.extend([k]*ht[k])
      return ret
  </code></pre>
  
  <p>As in the first two lines of the func, it's</p>
  
  <pre><code>ht = {}
  ht = defaultdict(lambda:0, ht)
  </code></pre>
  
  <p>I am not quite clear about this initialization.Could you kindly help me figure it out? and also, Shall we just replace these two lines with following?</p>
  
  <pre><code>ht = defaultdict(int) # default value 0
  </code></pre>