title: Unusual list comprehension behaviour
body: <p>I'm trying to port some code from Python to R and I've come across a list comprehension I cannot fully understand. Here is a toy example analogous to the code</p>
  
  <pre><code>import numpy as np
  theta = np.random.rand(5, 2, 2, 3)
  thetai = theta[0]
  
  logp = [theta[np.newaxis, ...] for theta in thetai]
  </code></pre>
  
  <p>If I run and print the results I get:</p>
  
  <pre><code>print(logp)
  [array([[[0.779, 0.461, 0.766],
          [0.245, 0.189, 0.045]]]), array([[[0.229, 0.288, 0.173],
          [0.011, 0.541, 0.528]]])]
  </code></pre>
  
  <p>Ok output is a list of two arrays. What I cannot understand is the <code>for theta in thetai</code> clause. Why? Because <code>theta</code> is a bigger array than <code>thetai</code>. <code>Theta</code> has shape (5,2,2,3) but <code>thetai</code> has shape (2,2,3). So what is the list comprehension actually doing when the code says <code>for biggerthing in smallerthing</code> ???</p>