Your second example is easier to just write as:
>>> from itertools import chain
>>> list_of_lists = [['a', 'b', 'c'], ['d', 'e', 'f']]
>>> list(chain(*list_of_lists))
['a', 'b', 'c', 'd', 'e', 'f']
That is, list(«foo») is clearer and more idiomatic than [x for x in «foo»].
Re:Ruby and Python: pivot points
by scottbessler on Sunday January 23, 2011 @10:31AM
(#2132527)
I may be missing something, but why isn't skipping your list comprehension maintaining the benefit of using a generator?
>>> from itertools import chain
>>> chain(*[['a', 'b', 'c'], ['d', 'e', 'f']])
http://docs.python.org/library/functions.html#sum
(Of course you lose the benefit of a generator by using a list comprehension, but this is just an example.)