Top-rated recipes by Guillaume Coffin http://code.activestate.com/recipes/users/4122066/top/2008-02-04T15:10:05-08:00ActiveState Code Recipesiterator with context (Python)
2008-02-04T15:10:05-08:00Guillaume Coffinhttp://code.activestate.com/recipes/users/4122066/http://code.activestate.com/recipes/544296-iterator-with-context/
<p style="color: grey">
Python
recipe 544296
by <a href="/recipes/users/4122066/">Guillaume Coffin</a>
(<a href="/recipes/tags/algorithms/">algorithms</a>).
</p>
<p>an iterator that keeps a list of the next and previous items in a fixed length window. For instance, one can obtain the 10 items that are ahead the current one.</p>