<div dir="ltr"><div><br></div><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 31, 2013 at 2:29 PM, Ulrich Goebel <span dir="ltr"><<a href="mailto:ml@fam-goebel.de" target="_blank">ml@fam-goebel.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hallo,<br>
<br>
I'm locking for an "iterator" type with not only the .next() method, but with a .previous(), .first() and .last() method, so that I can through it from the beginning or from the end, and in both directions, even alternately (for example two steps forward, one backward, two steps forward).<span class="HOEnZb"><font color="#888888"><br>
</font></span></blockquote><div><br></div><div>I'm thinking maybe you want a list.<br><br></div><div>EG:<br></div><div>   list_ = list(my_iterator())<br></div><div>   i = 0<br></div><div>   print list_[i]<br></div><div>
   i += 1<br></div><div>   print list_[i]   <br></div><div>   print list_[i-1]<br></div></div><br></div></div>