Skip to content

Commit ba024b9

Browse files
committed
Address the default integer dtype issue for 32/64-bit Python
Closes gh-151
1 parent bd667d0 commit ba024b9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

spec/API_specification/creation_functions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Convert the input to an array.
6868

6969
- **dtype**: _Optional\[ <dtype> ]_
7070

71-
- output array data type. If `dtype` is `None`, the output array data type must be inferred from the data type(s) in `obj`. Default: `None`.
71+
- output array data type. If `dtype` is `None`, the output array data type must be inferred from the data type(s) in `obj`. If all input values are Python scalars, then if they're all `bool` the output dtype will be `bool`; if they're a mix of `bool`s and `int` the output dtype will be the default integer data type; if they contain `float`s the output dtype will be the default floating-point data type. Default: `None`.
7272

7373
- **device**: _Optional\[ <device> ]_
7474

spec/API_specification/data_types.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
77
A conforming implementation of the array API standard must provide and support the following data types.
88

9-
A conforming implementation of the array API standard must define a default floating-point data type (either `float32` or `float64`), as well as a default data type for an array index (either `int32` or `int64`).
9+
A conforming implementation of the array API standard must define a default floating-point data type (either `float32` or `float64`), as well as a default integer data type (`int32` or `int64`). These default data types must be the same across platforms. The default integer data type may vary depending on whether Python is 32-bit or 64-bit.
1010

1111
```{note}
12-
13-
The default floating-point and array index integer data types should be clearly defined in a conforming library's documentation.
12+
The default floating-point and array index integer data types should be clearly defined in a conforming library's documentation. Furthermore, it must be documented whether arrays can be indexed with values larger than the largest `int32` value.
1413
```
1514

1615

0 commit comments

Comments
 (0)