Skip to content

Commit 72b2d64

Browse files
committed
🐟 work around a weird pyright inference bug
1 parent 7034061 commit 72b2d64

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/numpy-stubs/@test/runtime/legacy/mod.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
AR2 % td
2929

3030
divmod(td, td) # pyright: ignore[reportArgumentType, reportCallIssue] # microsoft/pyright#10899
31-
divmod(td, AR2)
31+
divmod(td, AR2) # pyright: ignore[reportCallIssue] # microsoft/pyright#10899
3232
divmod(AR2, td)
3333

3434
# Bool
@@ -49,7 +49,7 @@
4949
divmod(b, i8)
5050
divmod(b, u8)
5151
divmod(b_, f8)
52-
divmod(b_, AR)
52+
divmod(b_, AR) # pyright: ignore[reportCallIssue] # microsoft/pyright#10899
5353

5454
b % b_
5555
i % b_
@@ -91,7 +91,7 @@
9191
divmod(i8, f4)
9292
divmod(i4, i4)
9393
divmod(i4, f4)
94-
divmod(i8, AR)
94+
divmod(i8, AR) # pyright: ignore[reportCallIssue] # microsoft/pyright#10899
9595

9696
b % i8
9797
i % i8
@@ -130,7 +130,7 @@
130130
divmod(f8, f8)
131131
divmod(f8, f4)
132132
divmod(f4, f4)
133-
divmod(f8, AR)
133+
divmod(f8, AR) # pyright: ignore[reportCallIssue] # microsoft/pyright#10899
134134

135135
b % f8
136136
i % f8

src/numpy-stubs/@test/runtime/legacy/simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def iterable_func(x: Iterable[object]) -> Iterable[object]:
134134
array %= 1
135135

136136
divmod(array, 1) # pyright: ignore[reportArgumentType, reportCallIssue] # microsoft/pyright#10899
137-
divmod(1, nonzero_array)
137+
divmod(1, nonzero_array) # pyright: ignore[reportCallIssue] # microsoft/pyright#10899
138138

139139
array**1
140140
1**array

src/numpy-stubs/@test/static/accept/mod.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ assert_type(divmod(m_td, m_int), tuple[np.int64, np.timedelta64[int | None]]) #
7171
assert_type(divmod(m_td, m_td), tuple[np.int64, np.timedelta64[dt.timedelta | None]]) # pyright: ignore[reportArgumentType, reportAssertTypeFailure, reportCallIssue]
7272

7373
assert_type(divmod(AR_m, m), tuple[_nt.Array[np.int64], _nt.Array[np.timedelta64]])
74-
assert_type(divmod(m, AR_m), tuple[_nt.Array[np.int64], _nt.Array[np.timedelta64]])
74+
assert_type(divmod(m, AR_m), tuple[_nt.Array[np.int64], _nt.Array[np.timedelta64]]) # pyright: ignore[reportAssertTypeFailure, reportCallIssue]
7575

7676
# Bool
7777
assert_type(b_ % b, np.int8)
@@ -90,7 +90,7 @@ assert_type(divmod(b_, f), tuple[np.float64, np.float64]) # pyright: ignore[rep
9090
assert_type(divmod(b_, i8), tuple[np.int64, np.int64])
9191
assert_type(divmod(b_, u8), tuple[np.uint64, np.uint64])
9292
assert_type(divmod(b_, f8), tuple[np.float64, np.float64])
93-
assert_type(divmod(b_, AR_b), tuple[_nt.Array[np.int8], _nt.Array[np.int8]])
93+
assert_type(divmod(b_, AR_b), tuple[_nt.Array[np.int8], _nt.Array[np.int8]]) # pyright: ignore[reportAssertTypeFailure, reportCallIssue]
9494

9595
assert_type(b % b_, np.int8)
9696
assert_type(i % b_, np.intp)
@@ -130,7 +130,7 @@ assert_type(divmod(i8, i8), tuple[np.int64, np.int64])
130130
assert_type(divmod(i8, f8), tuple[np.float64, np.float64])
131131
assert_type(divmod(i8, f4), tuple[np.float64, np.float64])
132132
assert_type(divmod(i4, i4), tuple[np.int32, np.int32])
133-
assert_type(divmod(i8, AR_b), tuple[_nt.Array[np.int64], _nt.Array[np.int64]])
133+
assert_type(divmod(i8, AR_b), tuple[_nt.Array[np.int64], _nt.Array[np.int64]]) # pyright: ignore[reportAssertTypeFailure, reportCallIssue]
134134

135135
assert_type(b % i8, np.int64)
136136
assert_type(f % i8, np.float64)
@@ -165,7 +165,7 @@ assert_type(divmod(f8, f), tuple[np.float64, np.float64])
165165
assert_type(divmod(f8, f8), tuple[np.float64, np.float64])
166166
assert_type(divmod(f8, f4), tuple[np.float64, np.float64])
167167
assert_type(divmod(f4, f4), tuple[np.float32, np.float32])
168-
assert_type(divmod(f8, AR_b), tuple[_nt.Array[np.float64], _nt.Array[np.float64]])
168+
assert_type(divmod(f8, AR_b), tuple[_nt.Array[np.float64], _nt.Array[np.float64]]) # pyright: ignore[reportAssertTypeFailure, reportCallIssue]
169169

170170
assert_type(b % f8, np.float64)
171171
assert_type(f % f8, np.float64) # pyright: ignore[reportAssertTypeFailure] # pyright incorrectly infers `float`

0 commit comments

Comments
 (0)