Skip to content

Commit 5c1a69f

Browse files
committed
decimal: Python 3.13
1 parent 4f3c564 commit 5c1a69f

File tree

2 files changed

+127
-124
lines changed

2 files changed

+127
-124
lines changed

stdlib/@tests/stubtest_allowlists/linux-py313.txt

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -6,67 +6,6 @@ _stat.SF_SYNTHETIC
66
asyncio.unix_events.EventLoop
77
asyncio.unix_events._UnixSelectorEventLoop.create_unix_server
88
asyncio.unix_events.__all__
9-
decimal.Context.abs
10-
decimal.Context.add
11-
decimal.Context.canonical
12-
decimal.Context.compare
13-
decimal.Context.compare_signal
14-
decimal.Context.compare_total
15-
decimal.Context.compare_total_mag
16-
decimal.Context.copy_abs
17-
decimal.Context.copy_decimal
18-
decimal.Context.copy_negate
19-
decimal.Context.copy_sign
20-
decimal.Context.create_decimal
21-
decimal.Context.create_decimal_from_float
22-
decimal.Context.divide
23-
decimal.Context.divide_int
24-
decimal.Context.divmod
25-
decimal.Context.exp
26-
decimal.Context.fma
27-
decimal.Context.is_canonical
28-
decimal.Context.is_finite
29-
decimal.Context.is_infinite
30-
decimal.Context.is_nan
31-
decimal.Context.is_normal
32-
decimal.Context.is_qnan
33-
decimal.Context.is_signed
34-
decimal.Context.is_snan
35-
decimal.Context.is_subnormal
36-
decimal.Context.is_zero
37-
decimal.Context.ln
38-
decimal.Context.log10
39-
decimal.Context.logb
40-
decimal.Context.logical_and
41-
decimal.Context.logical_invert
42-
decimal.Context.logical_or
43-
decimal.Context.logical_xor
44-
decimal.Context.max
45-
decimal.Context.max_mag
46-
decimal.Context.min
47-
decimal.Context.min_mag
48-
decimal.Context.minus
49-
decimal.Context.multiply
50-
decimal.Context.next_minus
51-
decimal.Context.next_plus
52-
decimal.Context.next_toward
53-
decimal.Context.normalize
54-
decimal.Context.number_class
55-
decimal.Context.plus
56-
decimal.Context.quantize
57-
decimal.Context.remainder
58-
decimal.Context.remainder_near
59-
decimal.Context.rotate
60-
decimal.Context.same_quantum
61-
decimal.Context.scaleb
62-
decimal.Context.shift
63-
decimal.Context.sqrt
64-
decimal.Context.subtract
65-
decimal.Context.to_eng_string
66-
decimal.Context.to_integral
67-
decimal.Context.to_integral_exact
68-
decimal.Context.to_integral_value
69-
decimal.Context.to_sci_string
709
decimal.ConversionSyntax.handle
7110
decimal.Decimal.__abs__
7211
decimal.Decimal.__add__

stdlib/_decimal.pyi

Lines changed: 127 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -212,70 +212,134 @@ class Context:
212212
__hash__: ClassVar[None] # type: ignore[assignment]
213213
def Etiny(self) -> int: ...
214214
def Etop(self) -> int: ...
215-
def create_decimal(self, num: _DecimalNew = "0", /) -> Decimal: ...
216-
def create_decimal_from_float(self, f: float, /) -> Decimal: ...
217-
def abs(self, x: _Decimal, /) -> Decimal: ...
218-
def add(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
219-
def canonical(self, x: Decimal, /) -> Decimal: ...
220-
def compare(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
221-
def compare_signal(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
222-
def compare_total(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
223-
def compare_total_mag(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
224-
def copy_abs(self, x: _Decimal, /) -> Decimal: ...
225-
def copy_decimal(self, x: _Decimal, /) -> Decimal: ...
226-
def copy_negate(self, x: _Decimal, /) -> Decimal: ...
227-
def copy_sign(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
228-
def divide(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
229-
def divide_int(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
230-
def divmod(self, x: _Decimal, y: _Decimal, /) -> tuple[Decimal, Decimal]: ...
231-
def exp(self, x: _Decimal, /) -> Decimal: ...
232-
def fma(self, x: _Decimal, y: _Decimal, z: _Decimal, /) -> Decimal: ...
233-
def is_canonical(self, x: _Decimal, /) -> bool: ...
234-
def is_finite(self, x: _Decimal, /) -> bool: ...
235-
def is_infinite(self, x: _Decimal, /) -> bool: ...
236-
def is_nan(self, x: _Decimal, /) -> bool: ...
237-
def is_normal(self, x: _Decimal, /) -> bool: ...
238-
def is_qnan(self, x: _Decimal, /) -> bool: ...
239-
def is_signed(self, x: _Decimal, /) -> bool: ...
240-
def is_snan(self, x: _Decimal, /) -> bool: ...
241-
def is_subnormal(self, x: _Decimal, /) -> bool: ...
242-
def is_zero(self, x: _Decimal, /) -> bool: ...
243-
def ln(self, x: _Decimal, /) -> Decimal: ...
244-
def log10(self, x: _Decimal, /) -> Decimal: ...
245-
def logb(self, x: _Decimal, /) -> Decimal: ...
246-
def logical_and(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
247-
def logical_invert(self, x: _Decimal, /) -> Decimal: ...
248-
def logical_or(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
249-
def logical_xor(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
250-
def max(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
251-
def max_mag(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
252-
def min(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
253-
def min_mag(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
254-
def minus(self, x: _Decimal, /) -> Decimal: ...
255-
def multiply(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
256-
def next_minus(self, x: _Decimal, /) -> Decimal: ...
257-
def next_plus(self, x: _Decimal, /) -> Decimal: ...
258-
def next_toward(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
259-
def normalize(self, x: _Decimal, /) -> Decimal: ...
260-
def number_class(self, x: _Decimal, /) -> str: ...
261-
def plus(self, x: _Decimal, /) -> Decimal: ...
262-
def power(self, a: _Decimal, b: _Decimal, modulo: _Decimal | None = None) -> Decimal: ...
263-
def quantize(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
264-
def radix(self) -> Decimal: ...
265-
def remainder(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
266-
def remainder_near(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
267-
def rotate(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
268-
def same_quantum(self, x: _Decimal, y: _Decimal, /) -> bool: ...
269-
def scaleb(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
270-
def shift(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
271-
def sqrt(self, x: _Decimal, /) -> Decimal: ...
272-
def subtract(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
273-
def to_eng_string(self, x: _Decimal, /) -> str: ...
274-
def to_sci_string(self, x: _Decimal, /) -> str: ...
275-
def to_integral_exact(self, x: _Decimal, /) -> Decimal: ...
276-
def to_integral_value(self, x: _Decimal, /) -> Decimal: ...
277-
def to_integral(self, x: _Decimal, /) -> Decimal: ...
215+
if sys.version_info >= (3, 13) and sys.platform == "linux":
216+
def abs(self, a: _Decimal) -> Decimal: ...
217+
def add(self, a: _Decimal, b: _Decimal) -> Decimal: ...
218+
def copy_abs(self, a: _Decimal) -> Decimal: ...
219+
def copy_decimal(self, a: _Decimal) -> Decimal: ...
220+
def canonical(self, a: Decimal) -> Decimal: ...
221+
def compare(self, a: _Decimal, b: _Decimal) -> Decimal: ...
222+
def compare_signal(self, a: _Decimal, b: _Decimal) -> Decimal: ...
223+
def compare_total(self, a: _Decimal, b: _Decimal) -> Decimal: ...
224+
def compare_total_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ...
225+
def copy_negate(self, a: _Decimal) -> Decimal: ...
226+
def copy_sign(self, a: _Decimal, b: _Decimal) -> Decimal: ...
227+
def divide(self, a: _Decimal, b: _Decimal) -> Decimal: ...
228+
def divide_int(self, a: _Decimal, b: _Decimal) -> Decimal: ...
229+
def divmod(self, a: _Decimal, b: _Decimal) -> tuple[Decimal, Decimal]: ...
230+
def exp(self, a: _Decimal) -> Decimal: ...
231+
def fma(self, a: _Decimal, b: _Decimal, c: _Decimal) -> Decimal: ...
232+
def is_canonical(self, a: _Decimal) -> bool: ...
233+
def is_finite(self, a: _Decimal) -> bool: ...
234+
def is_infinite(self, a: _Decimal) -> bool: ...
235+
def is_nan(self, a: _Decimal) -> bool: ...
236+
def is_normal(self, a: _Decimal) -> bool: ...
237+
def is_qnan(self, a: _Decimal) -> bool: ...
238+
def is_signed(self, a: _Decimal) -> bool: ...
239+
def is_snan(self, a: _Decimal) -> bool: ...
240+
def is_subnormal(self, a: _Decimal) -> bool: ...
241+
def is_zero(self, a: _Decimal) -> bool: ...
242+
def ln(self, a: _Decimal) -> Decimal: ...
243+
def log10(self, a: _Decimal) -> Decimal: ...
244+
def logb(self, a: _Decimal) -> Decimal: ...
245+
def logical_and(self, a: _Decimal, b: _Decimal) -> Decimal: ...
246+
def logical_invert(self, a: _Decimal) -> Decimal: ...
247+
def logical_or(self, a: _Decimal, b: _Decimal) -> Decimal: ...
248+
def logical_xor(self, a: _Decimal, b: _Decimal) -> Decimal: ...
249+
def max(self, a: _Decimal, b: _Decimal) -> Decimal: ...
250+
def max_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ...
251+
def min(self, a: _Decimal, b: _Decimal) -> Decimal: ...
252+
def min_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ...
253+
def minus(self, a: _Decimal) -> Decimal: ...
254+
def multiply(self, a: _Decimal, b: _Decimal) -> Decimal: ...
255+
def next_minus(self, a: _Decimal) -> Decimal: ...
256+
def next_plus(self, a: _Decimal) -> Decimal: ...
257+
def next_toward(self, a: _Decimal, b: _Decimal) -> Decimal: ...
258+
def normalize(self, a: _Decimal) -> Decimal: ...
259+
def number_class(self, a: _Decimal) -> str: ...
260+
def plus(self, a: _Decimal) -> Decimal: ...
261+
def quantize(self, a: _Decimal, b: _Decimal) -> Decimal: ...
262+
def radix(self) -> Decimal: ...
263+
def remainder(self, a: _Decimal, b: _Decimal) -> Decimal: ...
264+
def remainder_near(self, a: _Decimal, b: _Decimal) -> Decimal: ...
265+
def rotate(self, a: _Decimal, b: _Decimal) -> Decimal: ...
266+
def same_quantum(self, a: _Decimal, b: _Decimal) -> bool: ...
267+
def scaleb(self, a: _Decimal, b: _Decimal) -> Decimal: ...
268+
def shift(self, a: _Decimal, b: _Decimal) -> Decimal: ...
269+
def sqrt(self, a: _Decimal) -> Decimal: ...
270+
def subtract(self, a: _Decimal, b: _Decimal) -> Decimal: ...
271+
def to_eng_string(self, a: _Decimal) -> str: ...
272+
def to_sci_string(self, a: _Decimal) -> str: ...
273+
def to_integral_exact(self, a: _Decimal) -> Decimal: ...
274+
def to_integral_value(self, a: _Decimal) -> Decimal: ...
275+
def to_integral(self, a: _Decimal) -> Decimal: ...
276+
def create_decimal(self, num: _DecimalNew = "0") -> Decimal: ...
277+
def create_decimal_from_float(self, f: float) -> Decimal: ...
278+
else:
279+
def create_decimal(self, num: _DecimalNew = "0", /) -> Decimal: ...
280+
def create_decimal_from_float(self, f: float, /) -> Decimal: ...
281+
def abs(self, x: _Decimal, /) -> Decimal: ...
282+
def add(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
283+
def copy_abs(self, x: _Decimal, /) -> Decimal: ...
284+
def copy_decimal(self, x: _Decimal, /) -> Decimal: ...
285+
def canonical(self, x: Decimal, /) -> Decimal: ...
286+
def compare(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
287+
def compare_signal(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
288+
def compare_total(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
289+
def compare_total_mag(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
290+
def copy_negate(self, x: _Decimal, /) -> Decimal: ...
291+
def copy_sign(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
292+
def divide(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
293+
def divide_int(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
294+
def divmod(self, x: _Decimal, y: _Decimal, /) -> tuple[Decimal, Decimal]: ...
295+
def exp(self, x: _Decimal, /) -> Decimal: ...
296+
def fma(self, x: _Decimal, y: _Decimal, z: _Decimal, /) -> Decimal: ...
297+
def is_canonical(self, x: _Decimal, /) -> bool: ...
298+
def is_finite(self, x: _Decimal, /) -> bool: ...
299+
def is_infinite(self, x: _Decimal, /) -> bool: ...
300+
def is_nan(self, x: _Decimal, /) -> bool: ...
301+
def is_normal(self, x: _Decimal, /) -> bool: ...
302+
def is_qnan(self, x: _Decimal, /) -> bool: ...
303+
def is_signed(self, x: _Decimal, /) -> bool: ...
304+
def is_snan(self, x: _Decimal, /) -> bool: ...
305+
def is_subnormal(self, x: _Decimal, /) -> bool: ...
306+
def is_zero(self, x: _Decimal, /) -> bool: ...
307+
def ln(self, x: _Decimal, /) -> Decimal: ...
308+
def log10(self, x: _Decimal, /) -> Decimal: ...
309+
def logb(self, x: _Decimal, /) -> Decimal: ...
310+
def logical_and(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
311+
def logical_invert(self, x: _Decimal, /) -> Decimal: ...
312+
def logical_or(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
313+
def logical_xor(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
314+
def max(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
315+
def max_mag(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
316+
def min(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
317+
def min_mag(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
318+
def minus(self, x: _Decimal, /) -> Decimal: ...
319+
def multiply(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
320+
def next_minus(self, x: _Decimal, /) -> Decimal: ...
321+
def next_plus(self, x: _Decimal, /) -> Decimal: ...
322+
def next_toward(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
323+
def normalize(self, x: _Decimal, /) -> Decimal: ...
324+
def number_class(self, x: _Decimal, /) -> str: ...
325+
def plus(self, x: _Decimal, /) -> Decimal: ...
326+
def quantize(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
327+
def radix(self) -> Decimal: ...
328+
def remainder(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
329+
def remainder_near(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
330+
def rotate(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
331+
def same_quantum(self, x: _Decimal, y: _Decimal, /) -> bool: ...
332+
def scaleb(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
333+
def shift(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
334+
def sqrt(self, x: _Decimal, /) -> Decimal: ...
335+
def subtract(self, x: _Decimal, y: _Decimal, /) -> Decimal: ...
336+
def to_eng_string(self, x: _Decimal, /) -> str: ...
337+
def to_sci_string(self, x: _Decimal, /) -> str: ...
338+
def to_integral_exact(self, x: _Decimal, /) -> Decimal: ...
339+
def to_integral_value(self, x: _Decimal, /) -> Decimal: ...
340+
def to_integral(self, x: _Decimal, /) -> Decimal: ...
278341

342+
def power(self, a: _Decimal, b: _Decimal, modulo: _Decimal | None = None) -> Decimal: ...
279343
DefaultContext: Context
280344
BasicContext: Context
281345
ExtendedContext: Context

0 commit comments

Comments
 (0)