title: Dict Index's in BeautifulSoup and "if x in Dict"
body: <p>I don't think I understand how to check if an array index exists...</p>
  
  <pre><code>for tag in soup.findAll("input"):
              print tag['type']
              if 'type' in tag:
                  print "b"
  </code></pre>
  
  <p>Outputs:</p>
  
  <pre><code>2255
  text
  hidden
  text
  text
  text
  Traceback (most recent call last):
    File "/home//workspace//src/x.py", line 268, in &lt;module&gt;
      print tag['type']
    File "/home//workspace//src/BeautifulSoup.py", line 601, in __getitem__
      return self._getAttrMap()[key]
  KeyError: 'type'
  </code></pre>
  
  <p>Why is it not outputting 'b' ever?</p>