Bump decimal to 3.14 (#14017)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Semyon Moroz
2025-05-12 05:23:21 +00:00
committed by GitHub
parent 30b7b679f5
commit d01b052dad
4 changed files with 17 additions and 5 deletions
+8
View File
@@ -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: ...