Add attributes to int and float (#2529)

* real, imag, conjugate all exist on int and float
* numerator, denominator exists on int
This commit is contained in:
Dave Halter
2018-10-23 00:44:36 +02:00
committed by Sebastian Rittau
parent f07bdf418b
commit a437fcc886
3 changed files with 48 additions and 0 deletions

View File

@@ -111,6 +111,16 @@ class int:
@overload
def __init__(self, x: Union[str, bytes], base: int) -> None: ...
@property
def real(self) -> int: ...
@property
def imag(self) -> int: ...
@property
def numerator(self) -> int: ...
@property
def denominator(self) -> int: ...
def conjugate(self) -> int: ...
def bit_length(self) -> int: ...
def to_bytes(self, length: int, byteorder: str, *, signed: bool = ...) -> bytes: ...
@classmethod
@@ -171,6 +181,12 @@ class float:
@classmethod
def fromhex(cls, s: str) -> float: ...
@property
def real(self) -> float: ...
@property
def imag(self) -> float: ...
def conjugate(self) -> float: ...
def __add__(self, x: float) -> float: ...
def __sub__(self, x: float) -> float: ...
def __mul__(self, x: float) -> float: ...