Skip to content

Commit 11253f4

Browse files
first pass at adding nditer typing tests
1 parent 6ffa543 commit 11253f4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import copy
2+
import numpy as np
3+
4+
nditer_obj: np.nditer
5+
6+
with nditer_obj as context:
7+
reveal_type(context) # E: numpy.nditer
8+
9+
reveal_type(len(nditer_obj)) # E: builtins.int
10+
reveal_type(copy.copy(nditer_obj)) # E: numpy.nditer
11+
reveal_type(next(nditer_obj)) # E: Any
12+
reveal_type(iter(nditer_obj)) # E: typing.Iterator[Any]
13+
reveal_type(nditer_obj[1]) # E: Any
14+
reveal_type(nditer_obj[1:5]) # E: Any
15+
16+
nditer_obj[1] = 1
17+
nditer_obj[1:5] = 1
18+
del nditer_obj[1]
19+
del nditer_obj[1:5]

0 commit comments

Comments
 (0)