Skip to content

Commit d4e9ab0

Browse files
committed
🐴 disable testgen mypy workaround for integer binops
1 parent 4651efd commit d4e9ab0

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

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

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

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

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

tool/testgen.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,17 +1025,9 @@ def _assert_stmt(self, op: str, lhs: str, rhs: str, /) -> str | None:
10251025
if (
10261026
op in self.OPS_ARITHMETIC | self.OPS_MODULAR
10271027
and lhs == rhs
1028-
and (abstract_arg := self.ABSTRACT_TYPES.get(self.names[lhs]))
1028+
and self.ABSTRACT_TYPES.get(self.names[lhs]) == "inexact"
10291029
):
1030-
if abstract_arg == "integer" and " + " not in op and " / " not in op:
1031-
mypy_ignore = "assert-type, operator"
1032-
elif abstract_arg == "inexact":
1033-
mypy_ignore = "operator"
1034-
else:
1035-
mypy_ignore = ""
1036-
1037-
if mypy_ignore:
1038-
stmt = " # ".join((stmt, f"type: ignore[{mypy_ignore}]", "🐴"))
1030+
stmt = f"{stmt} # type: ignore[operator] # 🐴"
10391031

10401032
return stmt
10411033

0 commit comments

Comments
 (0)