You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec/API_specification/array_object.md
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -654,6 +654,27 @@ Computes the truth value of `self_i > other_i` for each element of an array inst
654
654
Element-wise results must equal the results returned by the equivalent element-wise function [`greater(x1, x2)`](elementwise_functions.md#greaterx1-x2-).
655
655
```
656
656
657
+
(method-__index__)=
658
+
### \_\_index\_\_(self, /)
659
+
660
+
Converts a zero-dimensional integer array to a Python `int` object.
661
+
662
+
```{note}
663
+
This method is called to implement [`operator.index()`](https://docs.python.org/3/reference/datamodel.html#object.__index__). See also [PEP 357](https://www.python.org/dev/peps/pep-0357/).
664
+
```
665
+
666
+
#### Parameters
667
+
668
+
-**self**: _<array>_
669
+
670
+
- zero-dimensional array instance. Must have an integer data type.
671
+
672
+
#### Returns
673
+
674
+
-**out**: _<int>_
675
+
676
+
- a Python `int` object representing the single element of the array instance.
0 commit comments