Skip to content

Commit 153cc50

Browse files
committed
🐴 special-case a mypy false negative
1 parent 4e6345d commit 153cc50

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/numpy-stubs/@test/generated/ndarray_sub.pyi

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tool/testgen.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,13 @@ def _gen_testcases_binop_py_0d(
13931393
if out_dtypes:
13941394
out_type_expr = _array_expr(*out_dtypes, npt=True)
13951395
testcase = _expr_assert_type(expr, out_type_expr)
1396+
elif self.opname == "sub" and label_np == "b1" and name_py == "b_py":
1397+
# 🐴
1398+
testcase = " ".join((
1399+
expr,
1400+
"# 🐴",
1401+
f"# pyright: ignore[{self._pyright_rules}]",
1402+
))
13961403
else:
13971404
testcase = " ".join((
13981405
expr,

0 commit comments

Comments
 (0)