diff options
| author | Matthieu Dartiailh <m.dartiailh@gmail.com> | 2021-07-25 19:02:00 +0200 |
|---|---|---|
| committer | Matthieu Dartiailh <m.dartiailh@gmail.com> | 2021-07-25 19:02:22 +0200 |
| commit | 6ffa543c7ff3bf8702c4aad7f3b4512c53fed5d6 (patch) | |
| tree | 655cd70b42ce6fa59274a5a253bec012448685cb | |
| parent | c3d1107b8931313c85947439c406dab98ebfc8ea (diff) | |
| download | numpy-6ffa543c7ff3bf8702c4aad7f3b4512c53fed5d6.tar.gz | |
MAINT: add missing dunder methods to nditer type hints
The presence of __getattr__ is not sufficient to enable all protocols so explicitely add the dunder methods supported by nditer
| -rw-r--r-- | numpy/__init__.pyi | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi index 413a32569..95666d7ec 100644 --- a/numpy/__init__.pyi +++ b/numpy/__init__.pyi @@ -172,6 +172,7 @@ from typing import ( Generic, IO, Iterable, + Iterator, List, Mapping, NoReturn, @@ -778,6 +779,21 @@ class nditer: buffersize: Any = ..., ) -> Any: ... def __getattr__(self, key: str) -> Any: ... + def __enter__(self) -> nditer: ... + def __exit__( + self, + exc_type: None | Type[BaseException], + exc_value: None | BaseException, + traceback: None | TracebackType, + ) -> None: ... + def __iter__(self) -> Iterator[Any]: ... + def __next__(self) -> Any: ... + def __len__(self) -> int: ... + def __copy__(self) -> nditer: ... + def __getitem__(self, index: SupportsIndex | slice) -> Any: ... + def __setitem__(self, index: SupportsIndex | slice, value: Any) -> None: ... + def __delitem__(self, key: SupportsIndex | slice) -> None: ... + class poly1d: def __init__( |
