Skip to content

Commit 7972967

Browse files
committed
Add overloads for the mod function to support various input types
1 parent ccf9411 commit 7972967

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

stdlib/_operator.pyi

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,24 @@ def index(a: SupportsIndex, /) -> int: ...
6565
def inv(a: _SupportsInversion[_T_co], /) -> _T_co: ...
6666
def invert(a: _SupportsInversion[_T_co], /) -> _T_co: ...
6767
def lshift(a: Any, b: Any, /) -> Any: ...
68-
def mod(a: Any, b: Any, /) -> Any: ...
68+
@overload
69+
def mod(a: bool, b: bool, /) -> int: ...
70+
@overload
71+
def mod(a: bool, b: int, /) -> int: ...
72+
@overload
73+
def mod(a: bool, b: float, /) -> float: ...
74+
@overload
75+
def mod(a: int, b: bool, /) -> int: ...
76+
@overload
77+
def mod(a: int, b: int, /) -> int: ...
78+
@overload
79+
def mod(a: int, b: float, /) -> float: ...
80+
@overload
81+
def mod(a: float, b: bool, /) -> float: ...
82+
@overload
83+
def mod(a: float, b: int, /) -> float: ...
84+
@overload
85+
def mod(a: float, b: float, /) -> float: ...
6986
def mul(a: Any, b: Any, /) -> Any: ...
7087
def matmul(a: Any, b: Any, /) -> Any: ...
7188
def neg(a: _SupportsNeg[_T_co], /) -> _T_co: ...

0 commit comments

Comments
 (0)