Skip to content

Commit edcf0ea

Browse files
author
Bas van Beek
committed
DOC: Added a comment about weird flatiter.__getitem__ behavior
Contrary to `ndarray.__getitem__` its counterpart in `flatiter` does not accept objects with the `__array__` or `__index__` protocols; boolean indexing is just plain broken (gh-17175)
1 parent c04bb88 commit edcf0ea

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

numpy/tests/typing/fail/flatiter.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ def __index__(self) -> int:
1616
a.coords = Any # E: Property "coords" defined in "flatiter" is read-only
1717
a.index = Any # E: Property "index" defined in "flatiter" is read-only
1818
a.copy(order='C') # E: Unexpected keyword argument
19+
20+
# NOTE: Contrary to `ndarray.__getitem__` its counterpart in `flatiter`
21+
# does not accept objects with the `__array__` or `__index__` protocols;
22+
# boolean indexing is just plain broken (gh-17175)
1923
a[np.bool_()] # E: No overload variant of "__getitem__"
2024
a[Index()] # E: No overload variant of "__getitem__"
2125
a[supports_array] # E: No overload variant of "__getitem__"

0 commit comments

Comments
 (0)