Closed dirk-thomas closed 5 years ago
what about
char
andwchar
types?
What are you suggesting for those types? As far as I can see there are no corresponding dtypes
/ typecodes
for these primitives in numpy
/ array
.
As it stands, it looks like we'll end up with a
list
of them.
Correct.
Hmm, I initially noticed 'b', 'B' and 'u', but on a second look, it treats the first two as numbers and using 'u' would result on sequence<char>
and sequence<wchar>
being represented differently. Nevermind my comment.
This patch proposes to map (un)bounded sequences of numerics to array.array instead of numpy.ndarray.
An array provides the same interface as a Python list. It only uses memory closer to what the C representation needs (similar even though slightly higher than
numpy
) and also checks the value range of each item based on the typecode.