On Thu, Aug 13, 2020 at 12:27 PM Ben Rudiak-Gould <benrudiak@gmail.com> wrote:

I think islice should implement __length_hint__, though. As of 3.8.5 it doesn't.

And it could support __len__, and raise an Exception when the underlying iterable doesn’t support it.  

I know that itertools needs to support arbitrary iterable, but I do wish it provided more Sequence features when it could.

islice, for instance, could support negative indexes when it is wrapping a Sequence.

-CHB
--
Christopher Barker, PhD

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython