Add __bool__ to numeric builtin types

This commit is contained in:
Alex Frieder
2017-01-20 15:37:15 -05:00
committed by Łukasz Langa
parent db09b441ce
commit cf98162fca

View File

@@ -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