title: Convert OrderedDict to set in python
body: <p>I have an OrderedDict like this:</p>
  
  <pre><code>OrderedDict([
      (1666, [
          ['2ZNV', 'EDO1', 14, '2FCN', 'CD', 119],
          ['2ZNV', 'EDO', 14, '2FCN', 'CD', 119]]), 
      (1056, [['2ZNV', 'EDO', 32, '2FCN','CD', 33]]), 
      (266, [['2ZNV', 'EDO', 14, '2FCN', 'CD', 19]]), 
      (171, [
          ['2ZNV', 'ZN', 9, '2FCN', 'DVA', 19], 
          ['2ZNV', 'ZN', 9, '2FCN', 'CD', 19], 
          ['2ZNV', 'ZN', 9, '2FCN', 'ACT', 19], 
          ['2ZNV', 'EDO', 9, '2FCN', 'CD', 19], 
          ['2ZNV', 'EDO', 9, '2FCN', 'DVA', 19]]),
      (45, [
          ['2ZNV','EDO', 9, '2X8L', 'GOL', 5], 
          ['2ZNV', 'ZN', 9, '2X8L', 'GOL', 5]]),
      (6, [['2ZNV', 'EDO', 2, '2FCN', 'CD', 3]]), 
      (1, [['2ZNV', 'EDO', 1, '2FCN', 'CD', 1]])
  ])
  </code></pre>
  
  <p>Is it possible to add all the values in a <code>set</code> but keep the ordering? </p>
  
  <p>I tried to convert to list and then from tuple to set like this:</p>
  
  <pre><code>for k,v in od.items():
      listset.append(v)
  flat = [item for sublist in listset for item in sublist]
  xx = set(tuple(x) for x in flat)
  print xx
  </code></pre>
  
  <p>but this is not keep the ordering. The result of the above is:</p>
  
  <pre><code>set([
      ('2ZNV', 'ZN', 9, '2FCN', 'DVA', 19),
      ('2ZNV', 'EDO', 14, '2FCN', 'CD', 119),
      ('2ZNV', 'EDO', 9, '2X8L', 'GOL', 5),
      ('2ZNV', 'EDO', 32, '2FCN', 'CD', 33),
      ('2ZNV', 'EDO', 9, '2FCN', 'DVA', 19),
      ('2ZNV', 'ZN', 9, '2FCN', 'ACT', 19),
      ('2ZNV', 'EDO', 9, '2FCN', 'CD', 19),
      ('2ZNV', 'EDO', 1, '2FCN', 'CD', 1),
      ('2ZNV', 'EDO', 14, '2FCN', 'CD', 19),
      ('2ZNV', 'ZN', 9, '2X8L', 'GOL', 5),
      ('2ZNV', 'EDO1', 14, '2FCN', 'CD', 119),
      ('2ZNV', 'EDO', 2, '2FCN', 'CD', 3),
      ('2ZNV', 'ZN', 9,'2FCN', 'CD', 19)
  ])
  </code></pre>
  
  <p>Thank you in advance.</p>