mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-13 03:40:54 +08:00
Bump decimal to 3.14 (#14017)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import numbers
|
||||
import sys
|
||||
from _decimal import (
|
||||
HAVE_CONTEXTVAR as HAVE_CONTEXTVAR,
|
||||
HAVE_THREADS as HAVE_THREADS,
|
||||
@@ -28,6 +29,9 @@ from types import TracebackType
|
||||
from typing import Any, ClassVar, Literal, NamedTuple, final, overload, type_check_only
|
||||
from typing_extensions import Self, TypeAlias
|
||||
|
||||
if sys.version_info >= (3, 14):
|
||||
from _decimal import IEEE_CONTEXT_MAX_BITS as IEEE_CONTEXT_MAX_BITS, IEEEContext as IEEEContext
|
||||
|
||||
_Decimal: TypeAlias = Decimal | int
|
||||
_DecimalNew: TypeAlias = Decimal | float | str | tuple[int, Sequence[int], int]
|
||||
_ComparableNum: TypeAlias = Decimal | float | numbers.Rational
|
||||
@@ -66,6 +70,10 @@ class FloatOperation(DecimalException, TypeError): ...
|
||||
|
||||
class Decimal:
|
||||
def __new__(cls, value: _DecimalNew = "0", context: Context | None = None) -> Self: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
@classmethod
|
||||
def from_number(cls, number: Decimal | float, /) -> Self: ...
|
||||
|
||||
@classmethod
|
||||
def from_float(cls, f: float, /) -> Self: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user