title: Get the first item from an iterable that matches a condition
body: <p>I would like to get the first item from a list matching a condition. It's important that the resulting method not process the entire list, which could be quite large. For example, the following function is adequate:</p>
  
  <pre><code>def first(the_iterable, condition = lambda x: True):
      for i in the_iterable:
          if condition(i):
              return i
  </code></pre>
  
  <p>This function could be used something like this:</p>
  
  <pre><code>&gt;&gt;&gt; first(range(10))
  0
  &gt;&gt;&gt; first(range(10), lambda i: i &gt; 3)
  4
  </code></pre>
  
  <p>However, I can't think of a good built-in / one-liner to let me do this. I don't particularly want to copy this function around if I don't have to. Is there a built-in way to get the first item matching a condition?</p>