You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test-data/unit/check-ctypes.test
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ class MyCInt(ctypes.c_int):
7
7
intarr4 = ctypes.c_int * 4
8
8
a = intarr4(1, ctypes.c_int(2), MyCInt(3), 4)
9
9
intarr4(1, 2, 3, "invalid") # E: Array constructor argument 4 of type "str" is not convertible to the array element type "c_int"
10
-
reveal_type(a) # N: Revealed type is "ctypes.Array[ctypes.c_int]"
10
+
reveal_type(a) # N: Revealed type is "_ctypes.Array[ctypes.c_int]"
11
11
reveal_type(a[0]) # N: Revealed type is "builtins.int"
12
12
reveal_type(a[1:3]) # N: Revealed type is "builtins.list[builtins.int]"
13
13
a[0] = 42
@@ -33,7 +33,7 @@ myintarr4 = MyCInt * 4
33
33
mya = myintarr4(1, 2, MyCInt(3), 4)
34
34
myintarr4(1, ctypes.c_int(2), MyCInt(3), "invalid") # E: Array constructor argument 2 of type "c_int" is not convertible to the array element type "MyCInt" \
35
35
# E: Array constructor argument 4 of type "str" is not convertible to the array element type "MyCInt"
36
-
reveal_type(mya) # N: Revealed type is "ctypes.Array[__main__.MyCInt]"
36
+
reveal_type(mya) # N: Revealed type is "_ctypes.Array[__main__.MyCInt]"
37
37
reveal_type(mya[0]) # N: Revealed type is "__main__.MyCInt"
38
38
reveal_type(mya[1:3]) # N: Revealed type is "builtins.list[__main__.MyCInt]"
39
39
mya[0] = 42
@@ -63,7 +63,7 @@ class MyCInt(ctypes.c_int):
63
63
pass
64
64
65
65
mya: ctypes.Array[Union[MyCInt, ctypes.c_uint]]
66
-
reveal_type(mya) # N: Revealed type is "ctypes.Array[Union[__main__.MyCInt, ctypes.c_uint]]"
66
+
reveal_type(mya) # N: Revealed type is "_ctypes.Array[Union[__main__.MyCInt, ctypes.c_uint]]"
67
67
reveal_type(mya[0]) # N: Revealed type is "Union[__main__.MyCInt, builtins.int]"
68
68
reveal_type(mya[1:3]) # N: Revealed type is "builtins.list[Union[__main__.MyCInt, builtins.int]]"
69
69
# The behavior here is not strictly correct, but intentional.
0 commit comments