Best way to delimit a list?

Peter Otten __peter__ at web.de
Tue May 13 09:32:00 EDT 2008


Giuseppe Ottaviano wrote:

> def ichain(seq):
>         for s in seq:
>                 for x in s: yield x
> 
> (which is often useful and I don't think it has been included in  
> itertools) you can iterate lazily on the file:

Python 2.6 includes itertools.chain.from_iterable() with that functionality.

Peter



More information about the Python-list mailing list