Skip to content

map sequence to Python array.array()#217

Merged
dirk-thomas merged 1 commit intogh-pagesfrom
map_sequence_to_python_array
Mar 21, 2019
Merged

map sequence to Python array.array()#217
dirk-thomas merged 1 commit intogh-pagesfrom
map_sequence_to_python_array

Conversation

@dirk-thomas
Copy link
Copy Markdown
Member

@dirk-thomas dirk-thomas commented Mar 18, 2019

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.

@dirk-thomas dirk-thomas added the in review Waiting for review (Kanban column) label Mar 18, 2019
@dirk-thomas dirk-thomas self-assigned this Mar 18, 2019
Copy link
Copy Markdown

@hidmic hidmic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but what about char and wchar types? As it stands, it looks like we'll end up with a list of them.

@dirk-thomas
Copy link
Copy Markdown
Member Author

what about char and wchar 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.

@hidmic
Copy link
Copy Markdown

hidmic commented Mar 21, 2019

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.

@dirk-thomas dirk-thomas merged commit bf18495 into gh-pages Mar 21, 2019
@dirk-thomas dirk-thomas deleted the map_sequence_to_python_array branch March 21, 2019 17:32
@dirk-thomas dirk-thomas removed the in review Waiting for review (Kanban column) label Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants