Top-rated recipes tagged "iter" Code Recipespeek ahead an iterator (Python) 2010-08-17T13:41:41-07:00Quintijn Hoogenboom <p style="color: grey"> Python recipe 577361 by <a href="/recipes/users/4171692/">Quintijn Hoogenboom</a> (<a href="/recipes/tags/iter/">iter</a>, <a href="/recipes/tags/iterator/">iterator</a>, <a href="/recipes/tags/peek/">peek</a>, <a href="/recipes/tags/peeking/">peeking</a>). </p> <p>a merge of recipes 16.7 and 19.18 of the python cookbook (2nd edition).</p> <p>you can peek ahead more steps if needed, or just use the preview variable for the next item of the list.</p>