title: itertools.ifilter Vs. filter Vs. list comprehensions
body: <p>I am trying to become more familiar with the <code>itertools</code> module and have found a function called <code>ifilter</code>.</p>
  
  <p>From what I understand, it filters and iterable based on the given function and returns an iterator over a list containing the elements of the iterable on which the function evaluates to <code>True</code>. </p>
  
  <p><strong>Question 1</strong>: is my understanding thus far correct?</p>
  
  <p><strong>Question 2</strong>: aside from the fact that this returns and iterator, how is it different from the built-in <code>filter</code> function?</p>
  
  <p><strong>Question 3</strong> Which is faster?</p>
  
  <p>From what I can tell, it is not. Am I missing something? (I ran the following test)</p>
  
  <pre><code>&gt;&gt;&gt; itertools.ifilter(lambda x: x%2, range(5))
  &lt;itertools.ifilter object at 0x7fb1a101b210&gt;
  &gt;&gt;&gt; for i in itertools.ifilter(lambda x: x%2, range(5)): print i
  ... 
  1
  3
  &gt;&gt;&gt; filter(lambda x: x%2, range(5))
  [1, 3]
  &gt;&gt;&gt; function = lambda x: x%2
  &gt;&gt;&gt; [item for item in range(5) if function(item)]
  [1,3]
  </code></pre>