title: Python: understanding iterators and `join()` better
body: <p>The <code>join()</code> function accepts an iterable as parameter. However, I was wondering why having:</p>
  
  <pre><code>text = 'asdfqwer'
  </code></pre>
  
  <p>This:</p>
  
  <pre><code>''.join([c for c in text])
  </code></pre>
  
  <p>Is significantly faster than:</p>
  
  <pre><code>''.join(c for c in text)
  </code></pre>
  
  <p>The same occurs with long strings (i.e. <code>text * 10000000</code>).</p>
  
  <p>Watching the memory footprint of both executions with long strings, I think they both create one and only one list of chars in memory, and then join them into a string. So I am guessing perhaps the difference is only between how <code>join()</code> creates this list out of the generator and how the Python interpreter does the same thing when it sees <code>[c for c in text]</code>. But, again, I am just guessing, so I would like somebody to confirm/deny my guesses.</p>