title: building up lists as efficiently as possible in Python
body: <p>General question: is there a preferably style to building up a list, in terms of efficiency, assuming that you have to do it within a loop? For example, is one of these options preferable to building a list of integers:</p>
  
  <pre><code>mylist = []
  
  for x, y in mystuff:
    # x, y are strings that need to be
    # added sequentially to list
    mylist.extend([int(x), int(y)])
  </code></pre>
  
  <p>versus</p>
  
  <pre><code>for x, y in mystuff:
    mylist.append(int(x))
    mylist.append(int(y))
  </code></pre>
  
  <p>Or any others? Open to uses of scipy/numpy for this if relevant. thanks.</p>