title: Assigning NoneType to Dict
body: <p>I am trying to assign None to a key in a dict, but I am getting a TypeError:</p>
  
  <pre><code>self._rooms[g[0]] = None
  TypeError: 'NoneType' object does not support item assignment
  </code></pre>
  
  <p>My code is here:</p>
  
  <pre><code>r = open(filename, 'rU')
      for line in r:
          g = line.strip().split(',')
          if len(g) &gt; 1:
              r1 = g[0]
              h = Guest(g[1], str2date(g[2]), str2date(g[3]))
              self._rooms.set_guest(r1, h)
          else:
              self._rooms[g[0]] = None
      r.close()
  </code></pre>
  
  <p>Before it would let me assign, but not it won't. It is strange :/</p>