You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Issues with Decimal and three-argument pow() #130230
#130237 fixes the second issue. It was a regression in 3.13 (most likely introduced in #106078). In 3.12 and older, pow(10, 2, Decimal(7)) evaluates to Decimal('2').
The first issue is older (it exists from the beginning) and much more complex.
Activity
pythongh-130230: Fix crash in pow() with only Decimal third argument
serhiy-storchaka commentedon Feb 17, 2025
#130237 fixes the second issue. It was a regression in 3.13 (most likely introduced in #106078). In 3.12 and older,
pow(10, 2, Decimal(7))evaluates toDecimal('2').The first issue is older (it exists from the beginning) and much more complex.
skirpichev commentedon Feb 18, 2025
It's just an instance of #130104. I doubt we can do something on side of the pure-Python module.
BTW, 100% compatibility is not a goal here.
skirpichev commentedon Feb 18, 2025
Second issue works for me (no crash) for <3.13, removing label.
gh-130230: Fix crash in pow() with only Decimal third argument (GH-13…
pythongh-130230: Fix crash in pow() with only Decimal third argument (p…
[3.12] pythongh-130230: Fix crash in pow() with only Decimal third ar…
[3.12] pythongh-130230: Add new tests for 3-arg pow() with Decimal (p…
[3.12] gh-130230: Add new tests for 3-arg pow() with Decimal (GH-130237…
serhiy-storchaka commentedon Feb 18, 2025
I found these issues when writing tests for #130104, but I was not sure that it was the only cause.
[3.13] gh-130230: Fix crash in pow() with only Decimal third argument (…