title: What is the difference in Python defaultdict for d.get(key) vs d[key]?
body: <p>I was using python defaultdict and I noticed this: </p>
  
  <pre><code>from collections import defautdict
  
  class TrieNode(object):
      def __init__(self):
          self.children = defaultdict(TrieNode)
          self.is_word = False
  
  temp = TrieNode()
  </code></pre>
  
  <p>if I do:</p>
  
  <pre><code>temp = temp.children['A'] 
  </code></pre>
  
  <p><code>temp</code> will be a new <code>TrieNode</code> instance</p>
  
  <p>but if I do:</p>
  
  <pre><code>   temp = temp.children.get('B')
  </code></pre>
  
  <p><code>temp</code> can be None. </p>
  
  <p>Why would <code>d.get(key)</code> vs <code>d[key]</code> behave differently in defaultdict?? </p>