[issue21744] itertools.islice() goes over all the pre-initial elements even if the iterable can seek

Josh Rosenberg report at bugs.python.org
Sat Jun 14 04:06:23 CEST 2014


Josh Rosenberg added the comment:

I will admit, on further consideration, a dedicated sequenceview might work more nicely. islice's interface is limited by its generality; since it doesn't assume a length, you can't use a negative value for end.

Does anyone think a general sequenceview class would make sense (or a sequenceview function that returns either a general sequenceview or a memoryview, depending on what the underlying type is)? Might make an interesting project, whether or not islice is improved.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21744>
_______________________________________


More information about the Python-bugs-list mailing list