summaryrefslogtreecommitdiff
path: root/numpy/array_api/_array_object.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2020-11-09 18:07:23 -0600
committerGitHub <noreply@github.com>2020-11-09 18:07:23 -0600
commit17cd07f11fdbc6826c2ac5ae566012473ae94278 (patch)
tree0f43f3844cb567a3f04a7b8ac2cd0d8516ce0fee /numpy/array_api/_array_object.py
parente77b53a880edf16808488084c67ef090c69b3258 (diff)
downloadnumpy-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