[Python-ideas] Sequence views

Michael Selik michael.selik at gmail.com
Sun Jul 17 16:08:02 EDT 2016


On Sun, Jul 17, 2016, 3:22 PM Serhiy Storchaka <storchaka at gmail.com> wrote:

> Maybe it's time to add a new module for sequence-specific functions
> (seqtools?). It should contain at least two classes or fabric functions:
>
> 1. A view that represents a sliced subsequence. Lazy equivalent of
> seq[start:end:step]. This feature is implemented in third-party module
> dataview [1].
>
> 2. A view that represents a linear sequence as 2D array. Iterating this
> view emits non-intersecting chunks of the sequence. For example it can
> be used for representing the bytes object as a sequence of 1-byte bytes
> objects (as in 2.x), a generalized alternative to iterbytes() from PEP
> 467 [2].
>

NumPy slicing and reshaping sounds like it satisfies these requirements.
Does it not?

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160717/ae0c8d70/attachment.html>


More information about the Python-ideas mailing list