Itertools is designed for an efficient cycle. In particular, you may find that ifiltermeets your goal. Iterating through large data structures is always expensive, but if you only need some data in time, then a lazy evaluation can help.
, , , ( ) , .