As he says towards the beginning of his post, <i>Python 2.4 even adds a new kind of comprehension based on generators</i>; unless you actually <i>need</i> a list, you should use <i>generator expressions</i> as they use less memory (namely, as generators, individual items are lazy-loaded; in lists they are <i>all</i> loaded into memory)[1][2].<p>(That said, he also says towards the end: <i>Don't email me asking for me to optimize your code for you, [...] that's what the Python profiler is for</i>.)<p>[1] <a href="http://docs.python.org/reference/expressions.html#generator-expressions" rel="nofollow">http://docs.python.org/reference/expressions.html#generator-...</a>
[2] <a href="http://www.python.org/dev/peps/pep-0289/" rel="nofollow">http://www.python.org/dev/peps/pep-0289/</a>