Peter Otten wrote:
Nick Coghlan wrote:


from itertools import chain
n = [['N', 'F'], ['E'], ['D']]
print [chain(*n)]


However, [generator] is not the same as list(generator):

Heh - good point. As you say, replacing with list() gives the intended answer.

With regards to laziness, my main point was that itertools is handy for manipulating sequences, even if you aren't exploiting its capacity for lazy evaluation.

Cheers,
Nick.

--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to