data-apis / array-api-strict

Strict implementation of the Python array API (previously numpy.array_api)
http://data-apis.org/array-api-strict/
Other
11 stars 5 forks source link

ENH: allow python scalars in binary elementwise functions #100

Open ev-br opened 4 days ago

ev-br commented 4 days ago

towards #96

ev-br commented 4 days ago

TODO:

What's here now is likely too simple because this way python scalars can upcast arrays. So depending on what ends up in the standard this might need a tweak for "weak scalars" in the NEP 50 sense.

ev-br commented 1 day ago

cross-ref https://github.com/data-apis/array-api/pull/862

asmeurer commented 1 day ago

We need to make sure this properly disallows cross-kind combinations that aren't supported. That will presumably match the text here https://data-apis.org/array-api/latest/API_specification/type_promotion.html#mixing-arrays-with-python-scalars (if https://github.com/data-apis/array-api/issues/841 is implemented, real -> complex will also be allowed).