summaryrefslogtreecommitdiff
path: root/numpy/array_api/_manipulation_functions.py
diff options
context:
space:
mode:
authorAaron Meurer <asmeurer@gmail.com>2021-07-21 15:48:06 -0600
committerAaron Meurer <asmeurer@gmail.com>2021-07-21 15:48:06 -0600
commit63a9a87360ef492c46c37416b8270563e73a6349 (patch)
tree7d04d62253f2402d589803539d98875c60222fbc /numpy/array_api/_manipulation_functions.py
parent9d5d0ec2264c86a19714cf185a5a183df14cbb94 (diff)
downloadnumpy-63a9a87360ef492c46c37416b8270563e73a6349.tar.gz
Restrict the array API namespace array operator type promotions
Only those type promotions that are required by the spec are allowed. In particular, promotions across kinds, like integer + floating-point, are not allowed, except for the case of Python scalars. Tests are added for this. This commit additionally makes the operators return NotImplemented on unexpected input types rather than directly giving a TypeError. This is not strictly required by the array API spec, but it is generally considered a best practice for operator methods in Python. This same thing will be implemented for the various functions in the array API namespace in a later commit.
Diffstat (limited to 'numpy/array_api/_manipulation_functions.py')
0 files changed, 0 insertions, 0 deletions