title: Python: Compare 2 lists of tuples of different size
body: <p>I have 2 lists of tuples. The first list contains x entries with 2-tuples while the other list contains y (more) entries with 3-tuples.</p>
  
  <p>I want to compare both lists, but only the 1st and 2nd element of the tuples and basically just remove dublicates, but the 3rd entry of every tuple in the 2nd list should be not considered during the comparison.</p>
  
  <pre><code>list_x=[(1,1),(1,2),(2,3),(2,5),(4,6), ...]
  list_y=[(1,1,33),(1,3,65),(2,4,11), ...]
  </code></pre>
  
  <p>Now I want to create a new list where all elements from list_y which also occur in list_x are removed.
  The resulting list should look like this:</p>
  
  <pre><code>[(1,3,65),(2,4,11), ...]
  </code></pre>
  
  <p>For lists of tuples with the same size it works simply by just converting the lists to a set and subtract both lists:</p>
  
  <pre><code>newlist = list(set(list_y) - set(list_x))
  </code></pre>
  
  <p>it is also possible to sort the resulting list by the 2nd element of the tuples:</p>
  
  <pre><code>newlist.sort(key=lambda tup: tup[1])
  </code></pre>
  
  <p>But now the question is: how is it possible to do this if the lists look like above?</p>