An interesting point that has been hinted, but not explained, is that extend is faster than append. Any forFor any loop with anthat has append inside should be considered to be replaced by an extendlist.extend(processed_elements).
Bear in mind that apprending new elements might result in the realloaction of the whole list to a better location in memory. If this is done several times because we are appending 1 element at a time, overall performance suffers. In this sense, list.extend is analogous to "".join(stringlist).