<p dir="ltr"><br>
On 11 Jul 2013 17:38, "Oscar Benjamin" <<a href="mailto:oscar.j.benjamin@gmail.com">oscar.j.benjamin@gmail.com</a>> wrote:<br>
><br>
> On 11 July 2013 17:21, Russel Walker <<a href="mailto:russ.pobox@gmail.com">russ.pobox@gmail.com</a>> wrote:<br>
> > To confess, this is the second time I've made the mistake of trying to implement generator like functionality of a builtin when there already is on in itertools. Need to start studying that module abit more I think. I'm looking at the docs now and I see there are actually a couple of isomethings().<br>

><br>
> Your xslice (or mine) would still be better than islice when the step<br>
> size is large; islice has to iterate over all the skipped elements<br>
> which could be wasteful if the input is indexable. Also islice doesn't<br>
> support negative values for start, stop or step which xslice does.</p>
<p dir="ltr">Isn't all of itertools implemented in C? If we are not using a python-level and not-so-fast __getitem__ I would wager the C version is a lot faster.</p>
<p dir="ltr">And if the input is indexable could I assume that it is not too large to have around in memory and thus any speed increase in looping over it would be tiny?</p>