title: How to remove duplicate values from a list which are the values in the dictionary?
body: <p>I made a dictionary subclass that will store duplicated values in lists under the same key automatically from reference to</p>
  <p><a href="https://stackoverflow.com/questions/10664856/make-a-dictionary-with-duplicate-keys-in-python">Make a dictionary with duplicate keys in Python</a></p>
  <pre><code>class Dictlist(dict):
      def __setitem__(self, key, value):
          try:
              self[key]
          except KeyError:
              super(Dictlist, self).__setitem__(key, [])
          self[key].append(value)
  
  d = Dictlist()
  
  d['test'] = 1
  d['test'] = 2
  d['test'] = 1
  d['test'] = 1
  
  print(d)
  {'test' : [1,2,1,1]}
  for k,v in d.items():
      d[k] = list(set(v))
  
  print(d)
  {'test': [1, 2, 1, 1, [1, 2]]}
  </code></pre>
  <p>In this case, the new list is being added to the values list. I just want <code>[1,2]</code> in the values.</p>