mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
builtins: reorder overloads (#7828)
This is slightly more friendly for --no-strict-optional (gross)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user