diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2021-06-25 12:28:25 -0500 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2022-02-18 12:42:52 -0600 |
commit | 4c0a7ef61d89b61af7bb73f68070a590aa969aa3 (patch) | |
tree | 49d96c49520d49a2231cad426f289f15771302c5 /numpy/array_api/_array_object.py | |
parent | 91d49731cb5611135dc8810a2990e0acca34fdaa (diff) | |
download | numpy-4c0a7ef61d89b61af7bb73f68070a590aa969aa3.tar.gz |
ENH: Move `ensure_dtype_nbo` onto the DType as `ensure_canonical`
As part of NEP 42, I wish to generlize the "ensure-native-byteorder"
concept to the "canonical" concept.
This starts that process. The remaining (rather annoying) issue
is that I would have liked to add a `dtype.iscanonical` flag.
However, the `descr->flags` `char` is already used completely
which makes that a bit-nontrivial.
In principle we don't need `NPY_USE_GETITEM` and `NPY_USE_SETITEM`
(they do not need to be on the instance), but in practice they
are somewhat part of the public API...
An alternative may to be plan an `is_canonical` as a method (at least
in C), rather than a flag. We could even provide a default by using
`ensure_canonical` and then checking whether it is either the identical
descriptor or no-cast is necessary.
Diffstat (limited to 'numpy/array_api/_array_object.py')
0 files changed, 0 insertions, 0 deletions