diff options
author | John Zwinck <jzwinck@gmail.com> | 2016-07-05 16:11:50 -0500 |
---|---|---|
committer | John Zwinck <jzwinck@drwholdings.com> | 2016-07-05 16:12:41 -0500 |
commit | 7df226f11b571b9f67a73407624f303006e81f5f (patch) | |
tree | 278b2cfc7134f7fa3683c5a743f0651d5ab6672e /numpy/core/_internal.py | |
parent | 95e8a642759ccfccf6a37f1b07a2697f5d1bd736 (diff) | |
download | numpy-7df226f11b571b9f67a73407624f303006e81f5f.tar.gz |
BUG: interpret 'c' PEP3118/struct type as 'S1'.
Before this, a 'c' type code in a PEP3118 buffer would result in
failure to construct a NumPy array. Now it's interpreted as a
single character, as in Python's struct module. This means
'4c' is an array of 4 strings of size 1, while '4s' is (as before)
a single string of size 4.
Diffstat (limited to 'numpy/core/_internal.py')
-rw-r--r-- | numpy/core/_internal.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py index 5ad440fa4..85be66d06 100644 --- a/numpy/core/_internal.py +++ b/numpy/core/_internal.py @@ -370,6 +370,7 @@ def _view_is_safe(oldtype, newtype): _pep3118_native_map = { '?': '?', + 'c': 'S1', 'b': 'b', 'B': 'B', 'h': 'h', @@ -396,6 +397,7 @@ _pep3118_native_typechars = ''.join(_pep3118_native_map.keys()) _pep3118_standard_map = { '?': '?', + 'c': 'S1', 'b': 'b', 'B': 'B', 'h': 'i2', |