Skip to content

gh-73487: Convert _decimal to use Argument Clinic (part 4) - #137931

Merged
AA-Turner merged 5 commits into
python:mainfrom
skirpichev:ac-decimal/73487-pt4
Aug 20, 2025
Merged

gh-73487: Convert _decimal to use Argument Clinic (part 4)#137931
AA-Turner merged 5 commits into
python:mainfrom
skirpichev:ac-decimal/73487-pt4

Conversation

@skirpichev

@skirpichevskirpichev commented Aug 19, 2025

Copy link
Copy Markdown
Member

Comment threadModules/_decimal/_decimal.c Outdated
Comment threadModules/_decimal/_decimal.c
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@skirpichev

This comment was marked as outdated.

@skirpichev

Copy link
Copy Markdown
MemberAuthor

Docstrings diff:

--- ref.txt 2025-08-20 12:30:34.001295564 +0300+++ patch.txt 2025-08-20 12:29:57.118168737 +0300@@ -108,13 +108,16 @@
| Methods defined here:
|
| Etiny(self, /)
- | Return a value equal to Emin - prec + 1, which is the minimum exponent value- | for subnormal results. When underflow occurs, the exponent is set to Etiny.+ | Return a value equal to Emin - prec + 1.+ |+ | This is the minimum exponent value for subnormal results. When+ | underflow occurs, the exponent is set to Etiny.
|
| Etop(self, /)
- | Return a value equal to Emax - prec + 1. This is the maximum exponent- | if the _clamp field of the context is set to 1 (IEEE clamp mode). Etop()- | must not be negative.+ | Return a value equal to Emax - prec + 1.+ |+ | This is the maximum exponent if the _clamp field of the context is set+ | to 1 (IEEE clamp mode). Etop() must not be negative.
|
| __copy__(self, /)
|
@@ -437,10 +440,12 @@
class Decimal(builtins.object)
| Decimal(value='0', context=None)
|
- | Construct a new Decimal object. 'value' can be an integer, string, tuple,- | or another Decimal object. If no value is given, return Decimal('0'). The- | context does not affect the conversion and is only passed to determine if- | the InvalidOperation trap is active.+ | Construct a new Decimal object.+ |+ | value can be an integer, string, tuple, or another Decimal object. If+ | no value is given, return Decimal('0'). The context does not affect+ | the conversion and is only passed to determine if the InvalidOperation+ | trap is active.
|
| Methods defined here:
|
@@ -454,12 +459,14 @@
| True if self else False
|
| __ceil__(self, /)
+ | Return the ceiling as an Integral.
|
| __complex__(self, /)
+ | Convert this value to exact type complex.
|
| __copy__(self, /)
|
- | __deepcopy__(self, object, /)+ | __deepcopy__(self, memo, /)
|
| __divmod__(self, value, /)
| Return divmod(self, value).
@@ -471,6 +478,7 @@
| float(self)
|
| __floor__(self, /)
+ | Return the floor as an Integral.
|
| __floordiv__(self, value, /)
| Return self//value.
@@ -524,7 +532,7 @@
| Return divmod(value, self).
|
| __reduce__(self, /)
- | Helper for pickle.+ | Return state information for pickling.
|
| __repr__(self, /)
| Return repr(self).
@@ -538,7 +546,8 @@
| __rmul__(self, value, /)
| Return value*self.
|
- | __round__(...)+ | __round__(self, ndigits=<unrepresentable>, /)+ | Return the Integral closest to self, rounding half toward even.
|
| __rpow__(self, value, mod=None, /)
| Return pow(value, self, mod).
@@ -550,7 +559,7 @@
| Return value/self.
|
| __sizeof__(self, /)
- | Size of object in memory, in bytes.+ | Returns size in memory, in bytes
|
| __str__(self, /)
| Return str(self).
@@ -562,6 +571,7 @@
| Return self/value.
|
| __trunc__(self, /)
+ | Return the Integral closest to x between 0 and x.
|
| adjusted(self, /)
| Return the adjusted exponent (exp + digits - 1) of the number.

@serhiy-storchakaserhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

@AA-Turner

Copy link
Copy Markdown
Member

Thanks!

A

@AA-Turner
AA-Turner merged commit c056a08 into python:mainAug 20, 2025
46 checks passed
@skirpichev
skirpichev deleted the ac-decimal/73487-pt4 branch August 20, 2025 22:46
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@skirpichev@AA-Turner@serhiy-storchaka