mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
builtins: add __trunc__ to int and float (#3194)
See: https://docs.python.org/3/reference/datamodel.html#object.__trunc__ It also works on Python 2.7.
This commit is contained in:
committed by
Jelle Zijlstra
parent
fab2ee0d7c
commit
c0625d3280
@@ -183,6 +183,7 @@ class int:
|
||||
def __neg__(self) -> int: ...
|
||||
def __pos__(self) -> int: ...
|
||||
def __invert__(self) -> int: ...
|
||||
def __trunc__(self) -> int: ...
|
||||
if sys.version_info >= (3,):
|
||||
def __round__(self, ndigits: Optional[int] = ...) -> int: ...
|
||||
def __getnewargs__(self) -> Tuple[int]: ...
|
||||
@@ -240,6 +241,7 @@ class float:
|
||||
def __rdivmod__(self, x: float) -> Tuple[float, float]: ...
|
||||
def __rpow__(self, x: float) -> float: ...
|
||||
def __getnewargs__(self) -> Tuple[float]: ...
|
||||
def __trunc__(self) -> int: ...
|
||||
if sys.version_info >= (3,):
|
||||
@overload
|
||||
def __round__(self) -> int: ...
|
||||
|
||||
@@ -183,6 +183,7 @@ class int:
|
||||
def __neg__(self) -> int: ...
|
||||
def __pos__(self) -> int: ...
|
||||
def __invert__(self) -> int: ...
|
||||
def __trunc__(self) -> int: ...
|
||||
if sys.version_info >= (3,):
|
||||
def __round__(self, ndigits: Optional[int] = ...) -> int: ...
|
||||
def __getnewargs__(self) -> Tuple[int]: ...
|
||||
@@ -240,6 +241,7 @@ class float:
|
||||
def __rdivmod__(self, x: float) -> Tuple[float, float]: ...
|
||||
def __rpow__(self, x: float) -> float: ...
|
||||
def __getnewargs__(self) -> Tuple[float]: ...
|
||||
def __trunc__(self) -> int: ...
|
||||
if sys.version_info >= (3,):
|
||||
@overload
|
||||
def __round__(self) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user