title: python operator, no operator for "not in"
body: <p>This is a possibly silly question, but looking at <a href="http://docs.python.org/library/operator.html#mapping-operators-to-functions" rel="noreferrer">the mapping of operators to functions</a> I noticed that there is no function to express the <code>not in</code> operator.  At first I thought this was probably because the interpreter just reorders this to be <code>not x in y</code>, but there is a function for <code>is not</code> which seems like it should behave exactly the same as <code>not in</code>.  Am I missing something, or does that operator really not exist?</p>
  
  <p>Here's a really stupid example where you might want this:</p>
  
  <pre><code>def compare_iter(a,b,func):
      return [func(aa,bb) for aa,bb in zip(a,b)]
  
  my_compare=compare_iter(xx,yy,lambda x,y:x not in y)  #lambda -- yuck
  my_compare=map(operator.not_,compare_iter(xx,yy,operator.contains)  #extra map?  grr...
  #it would be nice to do: my_compare=compare_iter(xx,yy,operator.not_contains)
  </code></pre>
  
  <p>Of course I could write my own function for this, but then you pay a price in efficiency whereas the operator module could push this code out of python and therefore execute faster.</p>