title: Python generator that groups another iterable into groups of N
body: <p>I'm looking for a function that takes an iterable <code>i</code> and a size <code>n</code> and yields tuples of length <code>n</code> that are sequential values from <code>i</code>:</p>
  
  <pre><code>x = [1,2,3,4,5,6,7,8,9,0]
  [z for z in TheFunc(x,3)]
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>[(1,2,3),(4,5,6),(7,8,9),(0)]
  </code></pre>
  
  <p>Does such a function exist in the standard library?</p>
  
  <p>If it exists as part of the standard library, I can't seem to find it and I've run out of terms to search for. I could write my own, but I'd rather not.</p>