diff --git a/stdlib/2and3/decimal.pyi b/stdlib/2and3/decimal.pyi index 06193c7a7..91271981c 100644 --- a/stdlib/2and3/decimal.pyi +++ b/stdlib/2and3/decimal.pyi @@ -76,41 +76,71 @@ class Decimal(object): def __bool__(self) -> bool: ... else: def __nonzero__(self) -> bool: ... - def __eq__(self, other: object, context: Optional[Context] = ...) -> bool: ... - if sys.version_info < (3,): + def __div__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rdiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... def __ne__(self, other: object, context: Optional[Context] = ...) -> bool: ... - def __lt__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... - def __le__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... - def __gt__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... - def __ge__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def compare(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... def __hash__(self) -> int: ... def as_tuple(self) -> DecimalTuple: ... if sys.version_info >= (3,): def as_integer_ratio(self) -> Tuple[int, int]: ... - def __str__(self, eng: bool = ..., context: Optional[Context] = ...) -> str: ... + def to_eng_string(self, context: Optional[Context] = ...) -> str: ... - def __neg__(self, context: Optional[Context] = ...) -> Decimal: ... - def __pos__(self, context: Optional[Context] = ...) -> Decimal: ... - def __abs__(self, round: bool = ..., context: Optional[Context] = ...) -> Decimal: ... - def __add__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __radd__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __sub__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __rsub__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __mul__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __rmul__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __truediv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __rtruediv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - if sys.version_info < (3,): - def __div__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __rdiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __divmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Tuple[Decimal, Decimal]: ... - def __rdivmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Tuple[Decimal, Decimal]: ... - def __mod__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __rmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + + if sys.version_info >= (3,): + def __abs__(self) -> Decimal: ... + def __add__(self, other: _Decimal) -> Decimal: ... + def __divmod__(self, other: _Decimal) -> Tuple[Decimal, Decimal]: ... + def __eq__(self, other: object) -> bool: ... + def __floordiv__(self, other: _Decimal) -> Decimal: ... + def __ge__(self, other: _ComparableNum) -> bool: ... + def __gt__(self, other: _ComparableNum) -> bool: ... + def __le__(self, other: _ComparableNum) -> bool: ... + def __lt__(self, other: _ComparableNum) -> bool: ... + def __mod__(self, other: _Decimal) -> Decimal: ... + def __mul__(self, other: _Decimal) -> Decimal: ... + def __neg__(self) -> Decimal: ... + def __pos__(self) -> Decimal: ... + def __pow__(self, other: _Decimal, modulo: Optional[_Decimal] = ...) -> Decimal: ... + def __radd__(self, other: _Decimal) -> Decimal: ... + def __rdivmod__(self, other: _Decimal) -> Tuple[Decimal, Decimal]: ... + def __rfloordiv__(self, other: _Decimal) -> Decimal: ... + def __rmod__(self, other: _Decimal) -> Decimal: ... + def __rmul__(self, other: _Decimal) -> Decimal: ... + def __rsub__(self, other: _Decimal) -> Decimal: ... + def __rtruediv__(self, other: _Decimal) -> Decimal: ... + def __str__(self) -> str: ... + def __sub__(self, other: _Decimal) -> Decimal: ... + def __truediv__(self, other: _Decimal) -> Decimal: ... + else: + def __abs__(self, round: bool = ..., context: Optional[Context] = ...) -> Decimal: ... + def __add__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __divmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Tuple[Decimal, Decimal]: ... + def __eq__(self, other: object, context: Optional[Context] = ...) -> bool: ... + def __floordiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __ge__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __gt__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __le__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __lt__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __mod__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __mul__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __neg__(self, context: Optional[Context] = ...) -> Decimal: ... + def __pos__(self, context: Optional[Context] = ...) -> Decimal: ... + def __pow__(self, other: _Decimal, modulo: Optional[_Decimal] = ..., context: Optional[Context] = ...) -> Decimal: ... + def __radd__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rdivmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Tuple[Decimal, Decimal]: ... + def __rfloordiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rmul__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rsub__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rtruediv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __str__(self, eng: bool = ..., context: Optional[Context] = ...) -> str: ... + def __sub__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __truediv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def remainder_near(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __floordiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __rfloordiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __float__(self) -> float: ... def __int__(self) -> int: ... def __trunc__(self) -> int: ... @@ -130,7 +160,7 @@ class Decimal(object): else: def __long__(self) -> long: ... def fma(self, other: _Decimal, third: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __pow__(self, other: _Decimal, modulo: Optional[_Decimal] = ..., context: Optional[Context] = ...) -> Decimal: ... + def __rpow__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... def normalize(self, context: Optional[Context] = ...) -> Decimal: ... if sys.version_info >= (3,): @@ -246,69 +276,69 @@ class Context(object): __hash__: Any = ... def Etiny(self) -> int: ... def Etop(self) -> int: ... - def create_decimal(self, num: _DecimalNew = ...) -> Decimal: ... - def create_decimal_from_float(self, f: float) -> Decimal: ... - def abs(self, a: _Decimal) -> Decimal: ... - def add(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def canonical(self, a: Decimal) -> Decimal: ... - def compare(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def compare_signal(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def compare_total(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def compare_total_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def copy_abs(self, a: _Decimal) -> Decimal: ... - def copy_decimal(self, a: _Decimal) -> Decimal: ... - def copy_negate(self, a: _Decimal) -> Decimal: ... - def copy_sign(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def divide(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def divide_int(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def divmod(self, a: _Decimal, b: _Decimal) -> Tuple[Decimal, Decimal]: ... - def exp(self, a: _Decimal) -> Decimal: ... - def fma(self, a: _Decimal, b: _Decimal, c: _Decimal) -> Decimal: ... - def is_canonical(self, a: _Decimal) -> bool: ... - def is_finite(self, a: _Decimal) -> bool: ... - def is_infinite(self, a: _Decimal) -> bool: ... - def is_nan(self, a: _Decimal) -> bool: ... - def is_normal(self, a: _Decimal) -> bool: ... - def is_qnan(self, a: _Decimal) -> bool: ... - def is_signed(self, a: _Decimal) -> bool: ... - def is_snan(self, a: _Decimal) -> bool: ... - def is_subnormal(self, a: _Decimal) -> bool: ... - def is_zero(self, a: _Decimal) -> bool: ... - def ln(self, a: _Decimal) -> Decimal: ... - def log10(self, a: _Decimal) -> Decimal: ... - def logb(self, a: _Decimal) -> Decimal: ... - def logical_and(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def logical_invert(self, a: _Decimal) -> Decimal: ... - def logical_or(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def logical_xor(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def max(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def max_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def min(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def min_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def minus(self, a: _Decimal) -> Decimal: ... - def multiply(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def next_minus(self, a: _Decimal) -> Decimal: ... - def next_plus(self, a: _Decimal) -> Decimal: ... - def next_toward(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def normalize(self, a: _Decimal) -> Decimal: ... - def number_class(self, a: _Decimal) -> str: ... - def plus(self, a: _Decimal) -> Decimal: ... + def create_decimal(self, __num: _DecimalNew = ...) -> Decimal: ... + def create_decimal_from_float(self, __f: float) -> Decimal: ... + def abs(self, __x: _Decimal) -> Decimal: ... + def add(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def canonical(self, __x: Decimal) -> Decimal: ... + def compare(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def compare_signal(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def compare_total(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def compare_total_mag(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def copy_abs(self, __x: _Decimal) -> Decimal: ... + def copy_decimal(self, __x: _Decimal) -> Decimal: ... + def copy_negate(self, __x: _Decimal) -> Decimal: ... + def copy_sign(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def divide(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def divide_int(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def divmod(self, __x: _Decimal, __y: _Decimal) -> Tuple[Decimal, Decimal]: ... + def exp(self, __x: _Decimal) -> Decimal: ... + def fma(self, __x: _Decimal, __y: _Decimal, __z: _Decimal) -> Decimal: ... + def is_canonical(self, __x: _Decimal) -> bool: ... + def is_finite(self, __x: _Decimal) -> bool: ... + def is_infinite(self, __x: _Decimal) -> bool: ... + def is_nan(self, __x: _Decimal) -> bool: ... + def is_normal(self, __x: _Decimal) -> bool: ... + def is_qnan(self, __x: _Decimal) -> bool: ... + def is_signed(self, __x: _Decimal) -> bool: ... + def is_snan(self, __x: _Decimal) -> bool: ... + def is_subnormal(self, __x: _Decimal) -> bool: ... + def is_zero(self, __x: _Decimal) -> bool: ... + def ln(self, __x: _Decimal) -> Decimal: ... + def log10(self, __x: _Decimal) -> Decimal: ... + def logb(self, __x: _Decimal) -> Decimal: ... + def logical_and(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def logical_invert(self, __x: _Decimal) -> Decimal: ... + def logical_or(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def logical_xor(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def max(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def max_mag(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def min(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def min_mag(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def minus(self, __x: _Decimal) -> Decimal: ... + def multiply(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def next_minus(self, __x: _Decimal) -> Decimal: ... + def next_plus(self, __x: _Decimal) -> Decimal: ... + def next_toward(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def normalize(self, __x: _Decimal) -> Decimal: ... + def number_class(self, __x: _Decimal) -> str: ... + def plus(self, __x: _Decimal) -> Decimal: ... def power(self, a: _Decimal, b: _Decimal, modulo: Optional[_Decimal] = ...) -> Decimal: ... - def quantize(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def quantize(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... def radix(self) -> Decimal: ... - def remainder(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def remainder_near(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def rotate(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def same_quantum(self, a: _Decimal, b: _Decimal) -> bool: ... - def scaleb(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def shift(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def sqrt(self, a: _Decimal) -> Decimal: ... - def subtract(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def to_eng_string(self, a: _Decimal) -> str: ... - def to_sci_string(self, a: _Decimal) -> str: ... - def to_integral_exact(self, a: _Decimal) -> Decimal: ... - def to_integral_value(self, a: _Decimal) -> Decimal: ... - def to_integral(self, a: _Decimal) -> Decimal: ... + def remainder(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def remainder_near(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def rotate(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def same_quantum(self, __x: _Decimal, __y: _Decimal) -> bool: ... + def scaleb(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def shift(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def sqrt(self, __x: _Decimal) -> Decimal: ... + def subtract(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def to_eng_string(self, __x: _Decimal) -> str: ... + def to_sci_string(self, __x: _Decimal) -> str: ... + def to_integral_exact(self, __x: _Decimal) -> Decimal: ... + def to_integral_value(self, __x: _Decimal) -> Decimal: ... + def to_integral(self, __x: _Decimal) -> Decimal: ... DefaultContext: Context BasicContext: Context