News for hackers. Stuff that matters.
Re:NumPy Illustrated: The Visual Guide to NumPy by aldanor on Tuesday December 29, 2020 @12:28PM (#25572200)
If you're talking about non-contiguity due to multi-dimensionality (or strided slicing), PyBuffer already internally supports that (and thus memoryviews, stdlib array, etc) - [0], is that "pure Python" enough?

[0] https://docs.python.org/3/c-api/buffer.html#c.Py_buffer.stri...

Re:NumPy Illustrated: The Visual Guide to NumPy by enriquto on Tuesday December 29, 2020 @06:54PM (#25576599)
> is that "pure Python" enough?

Not at all! The PyBuffer library is all about interfacing to C data. As far as I know, creating a (mutable) contiguous array of floats is impossible in the Python language. This seems to be a deliberate language design decision.

Re:NumPy Illustrated: The Visual Guide to NumPy by axi1 on Wednesday December 30, 2020 @07:20AM (#25581042)
Re:NumPy Illustrated: The Visual Guide to NumPy by enriquto on Wednesday December 30, 2020 @03:08PM (#25585468)
My point exactly. The "array" class cannot be implemented in Python.
Re:NumPy Illustrated: The Visual Guide to NumPy by aldanor on Thursday December 31, 2020 @07:44PM (#25599262)
Uhh, so: Python has a language library feature that allows creating contiguous arrays, and hence it cannot be done in Python. Ok.

// Pretty much the entirety of CPython is written in C, including lists, dicts and everything else, not much different than the array.