builtins: reorder overloads (#7828)

This is slightly more friendly for --no-strict-optional (gross)
This commit is contained in:
Shantanu
2022-05-11 01:00:52 -07:00
committed by GitHub
parent 468d8adff1
commit a27f15ef0e

View File

@@ -250,10 +250,6 @@ class int:
def __rmod__(self, __x: int) -> int: ...
def __rdivmod__(self, __x: int) -> tuple[int, int]: ...
@overload
def __pow__(self, __x: int, __modulo: Literal[0]) -> NoReturn: ...
@overload
def __pow__(self, __x: int, __modulo: int) -> int: ...
@overload
def __pow__(self, __x: Literal[0]) -> Literal[1]: ...
@overload
def __pow__(self, __x: Literal[0], __modulo: None) -> Literal[1]: ...
@@ -265,6 +261,10 @@ class int:
# return type must be Any as `int | float` causes too many false-positive errors
@overload
def __pow__(self, __x: int, __modulo: None = ...) -> Any: ...
@overload
def __pow__(self, __x: int, __modulo: Literal[0]) -> NoReturn: ...
@overload
def __pow__(self, __x: int, __modulo: int) -> int: ...
def __rpow__(self, __x: int, __mod: int | None = ...) -> Any: ...
def __and__(self, __n: int) -> int: ...
def __or__(self, __n: int) -> int: ...