<p dir="ltr">I don't want to speak for Serhiy, but it seems like he wants NumPy-like behaviors over generic sequences. I think this idea is appealing. </p>
<p dir="ltr">For example, Python list has O(1) append, while the equivalent for np.ndarray would be an O(n) copy to a larger array.</p>
<p dir="ltr">Expressing those NumPy affordances genetically feels like a good thing. However, maybe this is something that could live in PyPI first top stabilize APIs.</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Jul 17, 2016 1:08 PM, "Michael Selik" <<a href="mailto:michael.selik@gmail.com">michael.selik@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote"><div dir="ltr">On Sun, Jul 17, 2016, 3:22 PM Serhiy Storchaka <<a href="mailto:storchaka@gmail.com" target="_blank">storchaka@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Maybe it's time to add a new module for sequence-specific functions<br>
(seqtools?). It should contain at least two classes or fabric functions:<br>
<br>
1. A view that represents a sliced subsequence. Lazy equivalent of<br>
seq[start:end:step]. This feature is implemented in third-party module<br>
dataview [1].<br>
<br>
2. A view that represents a linear sequence as 2D array. Iterating this<br>
view emits non-intersecting chunks of the sequence. For example it can<br>
be used for representing the bytes object as a sequence of 1-byte bytes<br>
objects (as in 2.x), a generalized alternative to iterbytes() from PEP<br>
467 [2].<br></blockquote></div><div><br></div><div>NumPy slicing and reshaping sounds like it satisfies these requirements. Does it not?</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div>
<br>_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br></blockquote></div></div>