title: Finding pairs of intersecting sets in a list of arbitrary sets
body: <p>You have an arbitrary number of sets, for example:</p>
  
  <pre><code>sets = [{1,2,3}, {3,4,5}, {5,6,7}]
  </code></pre>
  
  <p>You want to see if any value in one set is also in any other set. What is the most efficient way to do this?</p>
  
  <p>Currently I have the following:</p>
  
  <pre><code>index = 0
  for set in sets:
      for i in range(index + 1, len(sets)):
          print set, sets[i], set &amp; sets[i]
      index += 1
  </code></pre>
  
  <p>Which results in:</p>
  
  <pre><code>set([1, 2, 3]) set([3, 4, 5]) set([3])
  set([1, 2, 3]) set([5, 6, 7]) set([])
  set([3, 4, 5]) set([5, 6, 7]) set([5])
  </code></pre>