title: List comprehension without [ ] in Python
body: <p>Joining a list:</p>
  
  <pre><code>&gt;&gt;&gt; ''.join([ str(_) for _ in xrange(10) ])
  '0123456789'
  </code></pre>
  
  <p><code>join</code> must take an iterable.</p>
  
  <p>Apparently, <code>join</code>'s argument is <code>[ str(_) for _ in xrange(10) ]</code>, and it's a <a href="https://en.wikipedia.org/wiki/List_comprehension" rel="noreferrer">list comprehension</a>.</p>
  
  <p>Look at this:</p>
  
  <pre><code>&gt;&gt;&gt;''.join( str(_) for _ in xrange(10) )
  '0123456789'
  </code></pre>
  
  <p>Now, <code>join</code>'s argument is just <code>str(_) for _ in xrange(10)</code>, no <code>[]</code>, but the result is the same.</p>
  
  <p>Why? Does <code>str(_) for _ in xrange(10)</code> also produce a list or an iterable?</p>