title: Python: most effective way of filtering a list
body: <p>I hope I'm not duplicating here :-)</p>
  
  <p>I'm wondering what's the most effective way of filtering a python list.
  The task I have in hand is to find out list elements that are not appearing in some other list.</p>
  
  <p>My fist list is a list of objects (without unnecessary details):</p>
  
  <pre><code>Class A:
      def __init__(self,item1, item2):
          self.item1 = item1
          self.item2 = item2
  </code></pre>
  
  <p>later on, in my script I'm parsing a input text file and populating a <code>list1</code> with real data (both <code>item1</code> and <code>item2</code> fields are strings)</p>
  
  <p>there's also a second list, <code>list2</code> containing just a list of strings coresponding to <code>item1</code>. What I'm interested in, are the elements in <code>list1</code> where <code>item1</code> is not in the <code>list2</code>.
  <br>
   <i>(<code>list1</code> contains roughly 3000 elements, <code>list2</code> is bigger - circa 60000 elements. )</i></p>
  
  <p>my fist attempt is quite obvious:</p>
  
  <pre><code>notMatched = list(itertools.ifilter(lambda x: x.item1 not in list2), list1))
  </code></pre>
  
  <p>now, it works as expected, giving me exactly what I want, but I'm still wondering if it's the best solution I could came with.
  Any idea anyone?</p>
  
  <p>Thanks</p>