flatiter.py 842 B

12345678910111213141516171819202122232425
  1. from typing import Any
  2. import numpy as np
  3. from numpy.typing import _SupportsArray
  4. class Index:
  5. def __index__(self) -> int:
  6. ...
  7. a: "np.flatiter[np.ndarray]"
  8. supports_array: _SupportsArray
  9. a.base = Any # E: Property "base" defined in "flatiter" is read-only
  10. a.coords = Any # E: Property "coords" defined in "flatiter" is read-only
  11. a.index = Any # E: Property "index" defined in "flatiter" is read-only
  12. a.copy(order='C') # E: Unexpected keyword argument
  13. # NOTE: Contrary to `ndarray.__getitem__` its counterpart in `flatiter`
  14. # does not accept objects with the `__array__` or `__index__` protocols;
  15. # boolean indexing is just plain broken (gh-17175)
  16. a[np.bool_()] # E: No overload variant of "__getitem__"
  17. a[Index()] # E: No overload variant of "__getitem__"
  18. a[supports_array] # E: No overload variant of "__getitem__"