diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2022-01-27 13:20:54 -0600 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2022-06-12 13:56:58 -0700 |
commit | ac624d012cc0c3f90da4593e7bb8d9d335fa9696 (patch) | |
tree | 6830fb4fd70d2a880e090fed0ff9c317533a6f7f /numpy/array_api/_indexing_functions.py | |
parent | 4cb688938be2ff20bf939c3917fde2f7634f0500 (diff) | |
download | numpy-ac624d012cc0c3f90da4593e7bb8d9d335fa9696.tar.gz |
MAINT: Simplify element setting and use it for filling
This slightly modifies the behaviour of `arr.fill()` to be
`arr.fill(scalar)`, i.e. match `arr1d[0] = scalar`, rather than
`arr.fill(np.asarray(scalar))`, which subtely different!
(Note that object was already special cased to have the scalar
logic.)
Otherwise, `PyArray_Pack` is now the actual, full featured, "scalar"
assignment logic. It is a bit strange due to that quantity/masked
array issue, but there is nothing to be done about it.
The simplifications in `PyArray_AssignFromCache` should not cause
any change in practice, because non 0-D arrays would have been
rejected earlier on in that path.
(Basically, it does not need the full `PyArray_Pack` logic, but that
is fine, I intially split the two, but consolidated them again.)
Diffstat (limited to 'numpy/array_api/_indexing_functions.py')
0 files changed, 0 insertions, 0 deletions