From a27f15ef0eb12b961d0fb58f8615a3df901a9176 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Wed, 11 May 2022 01:00:52 -0700 Subject: [PATCH] builtins: reorder overloads (#7828) This is slightly more friendly for --no-strict-optional (gross) --- stdlib/builtins.pyi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 9e04ac4e5..d3d34c72f 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -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: ...