title: Python nested loop with generators does not work (in some cases)?
body: <p>Would somebody please explain the behavior of a nested loop using generators? Here is an example.</p>
  
  <pre><code>a = (x for x in range(3))
  b = (x for x in range(2))
  for i in a:
      for j in b:
          print (i,j)
  </code></pre>
  
  <p>The outer loop is not evaluated after the first iteration for some reason. The result is,</p>
  
  <pre><code>(0, 0)
  (0, 1)
  </code></pre>
  
  <p>On the other hand, if generators are directly inserted into the loops, it does what I expect.</p>
  
  <pre><code>for i in (x for x in range(3)):
      for j in (x for x in range(2)):
          print (i,j)
  </code></pre>
  
  <p>giving all 3x2 pairs.</p>
  
  <pre><code>(0, 0)
  (0, 1)
  (1, 0)
  (1, 1)
  (2, 0)
  (2, 1)
  </code></pre>