Skip to content

Commit 944e2b7

Browse files
committed
🐴 workaround for yet another mypy bug
1 parent 987a7ae commit 944e2b7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

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

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

tool/testgen.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ def _evaluate(self, op: str, lhs: str, rhs: str, /) -> str | None:
10481048

10491049
return f"tuple[{', '.join(result_exprs)}]" if nout > 1 else result_exprs[0]
10501050

1051-
def _assert_stmt(self, op: str, lhs: str, rhs: str, /) -> str | None:
1051+
def _assert_stmt(self, op: str, lhs: str, rhs: str, /) -> str | None: # noqa: C901
10521052
# ugly workaround for microsoft/pyright#9896 and microsoft/pyright#10899
10531053
if (
10541054
op.startswith("divmod")
@@ -1114,6 +1114,10 @@ def _assert_stmt(self, op: str, lhs: str, rhs: str, /) -> str | None:
11141114
if rhs == "M" or (rhs == "m" and ("==" in op or "!=" in op)):
11151115
result += " # type: ignore[assert-type]"
11161116

1117+
# yet another mypy workaround
1118+
if op.startswith("divmod") and lhs == rhs == "m":
1119+
result += " # type: ignore[assert-type]"
1120+
11171121
return result
11181122

11191123
@override

0 commit comments

Comments
 (0)