Generically, not genetically. Shouldn't reply on phone.
On Jul 17, 2016 2:56 PM, "David Mertz" firstname.lastname@example.org wrote:
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.
For example, Python list has O(1) append, while the equivalent for np.ndarray would be an O(n) copy to a larger array.
Expressing those NumPy affordances genetically feels like a good thing. However, maybe this is something that could live in PyPI first top stabilize APIs.
On Jul 17, 2016 1:08 PM, "Michael Selik" email@example.com wrote:
On Sun, Jul 17, 2016, 3:22 PM Serhiy Storchaka firstname.lastname@example.org 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:
- A view that represents a sliced subsequence. Lazy equivalent of
seq[start:end:step]. This feature is implemented in third-party module dataview .
- 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 .
NumPy slicing and reshaping sounds like it satisfies these requirements. Does it not?
Python-ideas mailing list Pythonemail@example.com https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/