Skip to content

Commit ff080c7

Browse files
committed
Add a result_type function to the API specification
Identified as needed in data-apisgh-14, also came up in data-apisgh-43 and data-apisgh-91.
1 parent 0015496 commit ff080c7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

spec/API_specification/utility_functions.md

+24
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,27 @@ Tests whether any input array element evaluates to `True` along a specified axis
6464
- **out**: _<array>_
6565

6666
- if a logical OR reduction was performed over the entire array, the returned array must be a zero-dimensional array containing the test result; otherwise, the returned array must be a non-zero-dimensional array containing the test results. The returned array must have a data type of `bool`.
67+
68+
69+
(function-result_type)=
70+
### result_type(*arrays_and_dtypes)
71+
72+
Returns the dtype that results from applying the type promotion rules
73+
(see {ref}`type-promotion`) to the arguments.
74+
75+
```{note}
76+
If mixed dtypes (e.g. integer and floating-point) are used, the output of
77+
`result_type` will be implementation-specific.
78+
```
79+
80+
#### Parameters
81+
82+
- **arrays_and_dtypes**: _List\[Union\[<array&gt, <dtype\]\];_
83+
84+
- input arrays and dtypes.
85+
86+
#### Returns
87+
88+
- **out**: _<dtype>_
89+
90+
- the dtype resulting from an operation involving the input arrays and dtypes.

0 commit comments

Comments
 (0)