Nested loops is strangely slow, totally at a loss.

Peter Otten __peter__ at web.de
Wed Dec 10 05:49:01 EST 2014


Shiyao Ma wrote:

> Thanks guys.
> 
> I was only aware of a limited iterables which themselves are iterators,
> e.g., the generator.
> 
> Seems like its really a pitfall. Any glossary, list on the iterables that
> *might* exhaust themselves?

Usually the test

iterable is iter(iterable)

returns True only for iterators.




More information about the Python-list mailing list