title: Python dictionary that maps strings to a set of strings?
body: <p>I would like to be able to make a Python dictionary with strings as keys and sets of strings as the values. E.g.: <code>{ "crackers" : ["crunchy", "salty"] }</code> It must be a set, not a list.</p>
  
  <p>However, when I try the following:</p>
  
  <pre><code>  word_dict = dict()
    word_dict["foo"] = set()
    word_dict["foo"] = word_dict["foo"].add("baz")                                    
    word_dict["foo"] = word_dict["foo"].add("bang")
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>Traceback (most recent call last):
    File "process_input.py", line 56, in &lt;module&gt;
      test()
    File "process_input.py", line 51, in test
      word_dict["foo"] = word_dict["foo"].add("bang")
  AttributeError: 'NoneType' object has no attribute 'add'
  </code></pre>
  
  <p>If I do this:</p>
  
  <pre><code>  word_dict = dict()
    myset = set()
    myset.add("bar")
    word_dict["foo"] = myset
    myset.add("bang")
    word_dict["foo"] = myset
  
    for key, value in word_dict:                                                       
        print key,                                                                
        print value
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>Traceback (most recent call last):
    File "process_input.py", line 61, in &lt;module&gt;
      test()
    File "process_input.py", line 58, in test
      for key, value in word_dict:
  ValueError: too many values to unpack
  </code></pre>
  
  <p>Any tips on how to coerce Python into doing what I'd like? I'm an intermediate Python user (or so I thought, until I ran into this problem.)</p>