summaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/numpy/typing/tests/data/fail/flatiter.pyi
blob: 06e23fed9e3f8affae8edd18d47f0f4704f7d96c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import numpy as np
import numpy._typing as npt

class Index:
    def __index__(self) -> int: ...

a: np.flatiter[npt.NDArray[np.float64]]
supports_array: npt._SupportsArray[np.dtype[np.float64]]

a.base = object()  # type: ignore[assignment, misc]
a.coords = object()  # type: ignore[assignment, misc]
a.index = object()  # type: ignore[assignment, misc]
a.copy(order='C')  # type: ignore[call-arg]

# NOTE: 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)
a[np.bool()]  # type: ignore[index]
a[Index()]  # type: ignore[call-overload]
a[supports_array]  # type: ignore[index]