title: Nested FOR loops are giving all permutations in one set. How would I split into two different associations?
body: <p>Lets say I have two dicts:</p>
  
  <pre><code>set1 = {"a":["description1", "description2"], "b":["description1", "description2"]}
  set2 = {"c":["description1", "description2"], "d":["description1", "description2"]}
  </code></pre>
  
  <p>I am looping through them with nested loops and calling a function like this:</p>
  
  <pre><code>for key1, value1 in sorted(figure1.objects1.iteritems()):
      for key2, value2 in sorted(figure2.objects.iteritems()):
          self.compare_objects(figure1.objects[key1], figure2.objects[key2])
  </code></pre>
  
  <p>I end up with the </p>
  
  <pre><code>set = {"ac":"matching descriptors", "bd":"matching descriptors", "ad":"matching descriptors", "bc":"matching descriptors"}
  </code></pre>
  
  <p>I would like to have the associations separated:</p>
  
  <pre><code>set1 = {"ac":"matching descriptors", "bd":"matching descriptors"}
  set2 = {"ad":"matching descriptors", "bc":"matching descriptors"}
  </code></pre>
  
  <p>This is because I am not sure which comparison is better and I need to check them against themselves.  This is a simple example.  Some of the later sets have 8 or more items each.</p>
  
  <p>Please help, I find the loops and iterations confusing.</p>