Toni Fuente via Tutor wrote:

>     strings_chunk = list(itertools.chain.from_iterable(chunk))
>     for item in strings_chunk:
         ...

Note that if you are iterating over strings_chunk just once there is no need 
to create an in-memory list.

for item in itertools.chain.from_iterable(chunk):
   ...

will work, too, without the consumption of time and memory needed to build 
the list.

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to