Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

skirpichev
Copy link
Contributor

@skirpichev skirpichev commented Aug 19, 2025

@skirpichev skirpichev force-pushed the ac-decimal/73487-pt4 branch from eedb68d to 9afbcfb Compare August 19, 2025 08:36
@skirpichev skirpichev force-pushed the ac-decimal/73487-pt4 branch from 0c6f7f7 to 8bb963f Compare August 19, 2025 08:59
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@skirpichev

This comment was marked as outdated.

@skirpichev
Copy link
Contributor Author

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.

Sign up for free to 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