Commit ea96e9b
committed
ENH: allow python scalars in binary elementwise functions
Allow func(array, scalar) and func(scalar, array), raise on
func(scalar, scalar) if API_VERSION>=2024.12
cross-ref data-apis/array-api#807
To make sure it is all uniform,
1. Generate all binary "ufuncs" in a uniform way, with a decorator
2. Make binary "ufuncs" follow the same logic of the binary operators
3. Reuse the test loop of Array.__binop__ for binary "ufuncs"
4. (minor) in tests, reuse canonical names for dtype categories
("integer or boolean" vs "integer_or_boolean")1 parent cf3f717 commit ea96e9b
File tree
5 files changed
+266
-512
lines changed- array_api_strict
- tests
5 files changed
+266
-512
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
233 | 235 | | |
234 | 236 | | |
235 | 237 | | |
| |||
0 commit comments