title: Why is a list comprehension so much faster than appending to a list?
body: <p>I was wondering why list comprehension is so much faster than appending to a list. I thought the difference is just expressive, but it's not.</p>
  
  <pre><code>&gt;&gt;&gt; import timeit 
  &gt;&gt;&gt; timeit.timeit(stmt='''\
  t = []
  for i in range(10000):
      t.append(i)''', number=10000)
  9.467898777974142
  
  &gt;&gt;&gt; timeit.timeit(stmt='t= [i for i in range(10000)]', number=10000)
  4.1138417314859
  </code></pre>
  
  <p>The list comprehension is 50% faster. Why?</p>