diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2020-11-09 18:07:23 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-09 18:07:23 -0600 |
commit | 17cd07f11fdbc6826c2ac5ae566012473ae94278 (patch) | |
tree | 0f43f3844cb567a3f04a7b8ac2cd0d8516ce0fee /numpy/array_api/_array_object.py | |
parent | e77b53a880edf16808488084c67ef090c69b3258 (diff) | |
download | numpy-17cd07f11fdbc6826c2ac5ae566012473ae94278.tar.gz |
BUG: Raise promotion error if a DType was provided in array coercion (gh-17706)
The new array coercion code incorrectly promoted to "object" when a promotion was impossible and
a dtype passed in. This likely only was relevant for `dtype="V"` where different void dtypes (structured
or different length) often cannot be promoted to each other.
Previously, this worked in some cases e.g. when the array contained byte strings the correct string
was found and then cast to void. Now the void dtypes are promoted, and this fails (unless the string
lengths match).
The error for promotion is now refined in this case.
Diffstat (limited to 'numpy/array_api/_array_object.py')
0 files changed, 0 insertions, 0 deletions