mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Add __bool__ to numeric builtin types
This commit is contained in:
committed by
Łukasz Langa
parent
db09b441ce
commit
cf98162fca
@@ -120,6 +120,7 @@ class int(SupportsInt, SupportsFloat, SupportsAbs[int]):
|
||||
def __int__(self) -> int: return self
|
||||
def __abs__(self) -> int: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
|
||||
class float(SupportsFloat, SupportsInt, SupportsAbs[float]):
|
||||
def __init__(self, x: Union[SupportsFloat, str, bytes] = ...) -> None: ...
|
||||
@@ -158,6 +159,7 @@ class float(SupportsFloat, SupportsInt, SupportsAbs[float]):
|
||||
def __float__(self) -> float: ...
|
||||
def __abs__(self) -> float: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
|
||||
class complex(SupportsAbs[float]):
|
||||
@overload
|
||||
@@ -191,6 +193,7 @@ class complex(SupportsAbs[float]):
|
||||
def __str__(self) -> str: ...
|
||||
def __abs__(self) -> float: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
|
||||
class str(Sequence[str]):
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user