8000 Revert "Remove an inconsistent rule about indexing" · lezcano/array-api@0009a82 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit 0009a82

Browse files
committed
Revert "Remove an inconsistent rule about indexing"
This reverts commit d9d51aa.
1 parent d9d51aa commit 0009a82

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

spec/API_specification/indexing.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ Slice syntax must have the following defaults. Let `n` be the axis (dimension) s
105105
- If `k` is greater than `0` and `j` is not provided (e.g., `0::2`), `j` must equal `n`.
106106
- If `k` is less than `0` and `i` is not provided (e.g., `:10:-2`), `i` must equal `n-1`.
107107
- If `k` is less than `0` and `j` is not provided (e.g., `0::-2`), `j` must equal `-n-1`.
108+
109+
Using a slice to index a single array axis must adhere to the following rules. Let `n` be the axis (dimension) size.
110+
111+
- If `i` equals `j`, a slice must return an empty array, whose axis (dimension) size along the indexed axis is `0`.
112+
108113
- Indexing via `:` and `::` must be equivalent and have defaults derived from the rules above. Both `:` and `::` indicate to select all elements along a single axis (dimension).
109114

110115
```{note}
@@ -179,4 +184,4 @@ The result of an indexing operation (e.g., multi-axis indexing, boolean array in
179184
```{note}
180185
181186
The specified return value behavior includes indexing operations which return a single value (e.g., accessing a single element within a one-dimensional array).
182-
```
187+
```

0 commit comments

Comments
 (0)
0