title: Python nested generators
body: <p>I was trying to implement the reverse function of itertools.izip on Python 2.7.1. The thing is that I find a problem, and I don't have an explantion. 
  Solution 1, iunzip_v1 works perfectly. But solution 2. iunzip_v2, doesn't works as expected. Til now, I haven't found any relevant information about this problem, and reading the PEP about generators, it sound it should work, but it doesn't.</p>
  
  <pre><code>import itertools
  from operator import itemgetter
  
  def iunzip_v1(iterable):
      _tmp, iterable = itertools.tee(iterable, 2)
      iters = itertools.tee(iterable, len(_tmp.next()))
      return tuple(itertools.imap(itemgetter(i), it) for i, it in enumerate(iters))
  
  def iunzip_v2(iterable):
      _tmp, iterable = itertools.tee(iterable, 2)
      iters = itertools.tee(iterable, len(_tmp.next()))
      return tuple((elem[i] for elem in it) for i, it in enumerate(iters))
  </code></pre>
  
  <p>result:</p>
  
  <pre><code>In [17]: l
  Out[17]: [(0, 0, 0), (1, 2, 3), (2, 4, 6), (3, 6, 9), (4, 8, 12)]
  
  In [18]: map(list, iunzip.iunzip_v1(l))
  Out[18]: [[0, 1, 2, 3, 4], [0, 2, 4, 6, 8], [0, 3, 6, 9, 12]]
  
  In [19]: map(list, iunzip.iunzip_v2(l))
  Out[19]: [[0, 3, 6, 9, 12], [0, 3, 6, 9, 12], [0, 3, 6, 9, 12]]
  </code></pre>
  
  <p>Seems that iunzip_v2 is using the last value, so the generators aren't keeping the value while they are created inside the first generator.
  I'm missing something and I don't know what is.</p>
  
  <p>Thanks in advance if something can clarify me this situation.</p>
  
  <p><strong>UPDATE:</strong> 
  I've found the explanation here <a href="http://www.python.org/dev/peps/pep-0289/#early-binding-versus-late-binding" rel="noreferrer">PEP-289</a>, my first read was at PEP-255.
  The solution I'm trying to implement is a lazy one, so:</p>
  
  <pre><code>  zip(*iter) or izip(*...)
  </code></pre>
  
  <p>doesn't work for me, because *arg expand the argument list.</p>