builtins: preparation for having the number types derive from the numbers ABCs by bluetech · Pull Request #3108 · python/typeshed · GitHub
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions stdlib/2/__builtin__.pyi
12 changes: 8 additions & 4 deletions stdlib/2and3/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class int:
def __rtruediv__(self, x: int) -> float: ...
def __rmod__(self, x: int) -> int: ...
def __rdivmod__(self, x: int) -> Tuple[int, int]: ...
def __pow__(self, x: int) -> Any: ... # Return type can be int or float, depending on x.
def __pow__(self, x: int, modulo: Optional[int] = ...) -> Any: ... # Return type can be int or float, depending on x.
def __rpow__(self, x: int) -> Any: ...
def __and__(self, n: int) -> int: ...
def __or__(self, n: int) -> int: ...
Expand All @@ -185,6 +185,9 @@ class int:
def __invert__(self) -> int: ...
if sys.version_info >= (3,):
def __round__(self, ndigits: Optional[int] = ...) -> int: ...
def __trunc__(self) -> int: ...
def __floor__(self) -> int: ...
def __ceil__(self) -> int: ...
def __getnewargs__(self) -> Tuple[int]: ...

def __eq__(self, x: object) -> bool: ...
Expand Down Expand Up @@ -242,11 +245,12 @@ class float:
def __getnewargs__(self) -> Tuple[float]: ...
if sys.version_info >= (3,):
@overload
def __round__(self) -> int: ...
@overload
def __round__(self, ndigits: None) -> int: ...
def __round__(self, ndigits: None = ...) -> int: ...
@overload
def __round__(self, ndigits: int) -> float: ...
def __trunc__(self) -> int: ...
def __floor__(self) -> int: ...
def __ceil__(self) -> int: ...

def __eq__(self, x: object) -> bool: ...
def __ne__(self, x: object) -> bool: ...
Expand Down
8 changes: 6 additions & 2 deletions stdlib/2and3/numbers.pyi