title: TypeError: first argument must be callable
body: <pre><code>fs = codecs.open('grammar_new.txt', encoding='utf-8')
  unidata=[]
  d={}
  fr=codecs.open('rule.txt', 'w')
  for line in fs:
      line_data=line.split()
      for i in range(0,len(line_data)):
         unidata.append(line_data[i])
  
  
  d = defaultdict(unidata)
  </code></pre>
  
  <p>while executing this code will generate error as  d = defaultdict(unidata)
  TypeError: first argument must be callable..I want to store duplicate keys in dictionary</p>