3 ms·
> 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
by enriquto 6y ago
> 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.
- axi1 6y agohttps://docs.python.org/3/library/array.html https://docs.python.org/3/library/array.html
- enriquto 6y agoMy point exactly. The "array" class cannot be implemented in Python.
- aldanor 6y agoUhh, 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.