summaryrefslogtreecommitdiff
path: root/numpy/array_api/_constants.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2022-03-11 15:33:27 -0800
committerSebastian Berg <sebastian@sipsolutions.net>2022-04-24 21:47:50 +0200
commitfd9c3efc2d7c0721e537bda2538d78995d14ec7c (patch)
tree07b9e5ac984a36f6b02f6f8bc81ef8589aee0df5 /numpy/array_api/_constants.py
parent732ed25e4a1e3802d82a976f9541f74548b13e6f (diff)
downloadnumpy-fd9c3efc2d7c0721e537bda2538d78995d14ec7c.tar.gz
MAINT,ENH: Rewrite scalar math logic
This commit tries to redo the scalar math logic to take some more care about subclasses, but most of all introduce logic to defer to the `other` if `self` can be cast to it safely (i.e. it is the correct promotion). This makes things much faster and more reliable, since we now use defer much less to `ufuncs` indirectly. This ensures that integer overflows are reported more reliably. Another major point about it, is that this reorganizes the coercion of Python int, float, complex (and bool). This should help a bit with switching to "weak" Python scalars. This may just be a first step on a longer path...
Diffstat (limited to 'numpy/array_api/_constants.py')
0 files changed, 0 insertions, 0 deletions