diff options
| author | Matthieu Dartiailh <m.dartiailh@gmail.com> | 2021-07-27 08:46:18 +0200 |
|---|---|---|
| committer | Matthieu Dartiailh <m.dartiailh@gmail.com> | 2021-07-27 08:46:18 +0200 |
| commit | 11253f4342904285abdd7575d3acc40f9ef3ed2f (patch) | |
| tree | 85e4764accb51ea1e433afbe7869b25421ae59d4 /numpy | |
| parent | 6ffa543c7ff3bf8702c4aad7f3b4512c53fed5d6 (diff) | |
| download | numpy-11253f4342904285abdd7575d3acc40f9ef3ed2f.tar.gz | |
first pass at adding nditer typing tests
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/typing/tests/data/reveal/nditer.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/numpy/typing/tests/data/reveal/nditer.py b/numpy/typing/tests/data/reveal/nditer.py new file mode 100644 index 000000000..de2a4b5ed --- /dev/null +++ b/numpy/typing/tests/data/reveal/nditer.py @@ -0,0 +1,19 @@ +import copy +import numpy as np + +nditer_obj: np.nditer + +with nditer_obj as context: + reveal_type(context) # E: numpy.nditer + +reveal_type(len(nditer_obj)) # E: builtins.int +reveal_type(copy.copy(nditer_obj)) # E: numpy.nditer +reveal_type(next(nditer_obj)) # E: Any +reveal_type(iter(nditer_obj)) # E: typing.Iterator[Any] +reveal_type(nditer_obj[1]) # E: Any +reveal_type(nditer_obj[1:5]) # E: Any + +nditer_obj[1] = 1 +nditer_obj[1:5] = 1 +del nditer_obj[1] +del nditer_obj[1:5] |
