From a437fcc886e003071e677d1e710e137e7454c622 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Tue, 23 Oct 2018 00:44:36 +0200 Subject: [PATCH] Add attributes to int and float (#2529) * real, imag, conjugate all exist on int and float * numerator, denominator exists on int --- stdlib/2/__builtin__.pyi | 16 ++++++++++++++++ stdlib/2/builtins.pyi | 16 ++++++++++++++++ stdlib/3/builtins.pyi | 16 ++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index 4dc1b434b..db985272d 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -95,6 +95,16 @@ class int: @overload def __init__(self, x: Union[str, unicode, bytearray], 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 __add__(self, x: int) -> int: ... @@ -152,6 +162,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: ... diff --git a/stdlib/2/builtins.pyi b/stdlib/2/builtins.pyi index 4dc1b434b..db985272d 100644 --- a/stdlib/2/builtins.pyi +++ b/stdlib/2/builtins.pyi @@ -95,6 +95,16 @@ class int: @overload def __init__(self, x: Union[str, unicode, bytearray], 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 __add__(self, x: int) -> int: ... @@ -152,6 +162,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: ... diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index b75254d06..8b8b34892 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -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: ...