Skip to content

Commit a27f15e

Browse files
authored
builtins: reorder overloads (#7828)
This is slightly more friendly for --no-strict-optional (gross)
1 parent 468d8ad commit a27f15e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/builtins.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,6 @@ class int:
250250
def __rmod__(self, __x: int) -> int: ...
251251
def __rdivmod__(self, __x: int) -> tuple[int, int]: ...
252252
@overload
253-
def __pow__(self, __x: int, __modulo: Literal[0]) -> NoReturn: ...
254-
@overload
255-
def __pow__(self, __x: int, __modulo: int) -> int: ...
256-
@overload
257253
def __pow__(self, __x: Literal[0]) -> Literal[1]: ...
258254
@overload
259255
def __pow__(self, __x: Literal[0], __modulo: None) -> Literal[1]: ...
@@ -265,6 +261,10 @@ class int:
265261
# return type must be Any as `int | float` causes too many false-positive errors
266262
@overload
267263
def __pow__(self, __x: int, __modulo: None = ...) -> Any: ...
264+
@overload
265+
def __pow__(self, __x: int, __modulo: Literal[0]) -> NoReturn: ...
266+
@overload
267+
def __pow__(self, __x: int, __modulo: int) -> int: ...
268268
def __rpow__(self, __x: int, __mod: int | None = ...) -> Any: ...
269269
def __and__(self, __n: int) -> int: ...
270270
def __or__(self, __n: int) -> int: ...

0 commit comments

Comments
 (0)