diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2022-08-05 10:11:08 +0530 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2022-08-05 10:28:28 +0530 |
commit | e3bcb6a7e54239ee83e0f9ca80cf71dd8f35bec9 (patch) | |
tree | d0adbdebfce79eabce70568d551d9da47c4c1dc3 /numpy/array_api/_array_object.py | |
parent | f4f7595e99fffffe15effdaefe12cb7ef686ec6f (diff) | |
download | numpy-e3bcb6a7e54239ee83e0f9ca80cf71dd8f35bec9.tar.gz |
BUG: Replace assert with correct error
If we cache a promoted version of the loop, that promoted can mismatch
the correct one. This ends up being rejected later in the legacy paths
(should be the only path currently used), but we should reject it here
(or in principle we could reject it after cache lookup, but we are fixing
up the operation DTypes here anyway, so we are looking at the signature).
A call sequence reproducing this directly is:
np.add(1, 2, signature=(bool, int, None)) # should fail
np.add(True, 2) # A promoted loop
np.add(1, 2, signature=(bool, int, None)) # should still fail
Not that the errors differ, because the first one comes from the old
type resolution code and is currently less precise
Diffstat (limited to 'numpy/array_api/_array_object.py')
0 files changed, 0 insertions, 0 deletions