Skip to content

Commit 0a89981

Browse files
committed
🐴 disable testgen mypy workaround for inexact binops
1 parent 2b5bfb4 commit 0a89981

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

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

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

tool/testgen.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,17 +1019,7 @@ def _assert_stmt(self, op: str, lhs: str, rhs: str, /) -> str | None:
10191019
if expr_type == "bool":
10201020
return None
10211021

1022-
stmt = _expr_assert_type(expr_eval, expr_type)
1023-
1024-
# workaround for mypy's lack of support for reflected binary ops like __radd__
1025-
if (
1026-
op in self.OPS_ARITHMETIC | self.OPS_MODULAR
1027-
and lhs == rhs
1028-
and self.ABSTRACT_TYPES.get(self.names[lhs]) == "inexact"
1029-
):
1030-
stmt = f"{stmt} # type: ignore[operator] # 🐴"
1031-
1032-
return stmt
1022+
return _expr_assert_type(expr_eval, expr_type)
10331023

10341024
@override
10351025
def _generate_names_section(self) -> Generator[str]:

0 commit comments

Comments
 (0)