GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-73487: Convert _decimal to use Argument Clinic (part 4) by skirpichev · Pull Request #137931 · python/cpython

Conversation

@skirpichev

@skirpichev skirpichev commented Aug 19, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: decimal: Use Argument Clinic #73487

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot mentioned this pull request Aug 19, 2025
decimal: Use Argument Clinic #73487
Closed
@skirpichev
skirpichev requested review from AA-Turner and serhiy-storchaka August 19, 2025 02:05
@skirpichev skirpichev added the skip news label Aug 19, 2025
@skirpichev skirpichev mentioned this pull request Aug 19, 2025
gh-73487: Convert _decimal to use Argument Clinic (part 3) #137844
Merged
@skirpichev skirpichev added the topic-argument-clinic label Aug 19, 2025
@skirpichev
skirpichev marked this pull request as ready for review August 19, 2025 08:21
@bedevere-app bedevere-app Bot added the awaiting review label Aug 19, 2025
@skirpichev
pythongh-73487: Convert _decimal to use Argument Clinic (part 4)
9afbcfb
@skirpichev
skirpichev force-pushed the ac-decimal/73487-pt4 branch from eedb68d to 9afbcfb Compare August 19, 2025 08:36
@skirpichev
+ rename parameters
8bb963f
@skirpichev
skirpichev force-pushed the ac-decimal/73487-pt4 branch from 0c6f7f7 to 8bb963f Compare August 19, 2025 08:59
serhiy-storchaka
serhiy-storchaka reviewed Aug 19, 2025
View reviewed changes
Comment thread Modules/_decimal/_decimal.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_decimal/_decimal.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@skirpichev @serhiy-storchaka
Update Modules/_decimal/_decimal.c
b778703
Co-authored-by: Serhiy Storchaka <[email protected]>
@skirpichev
skirpichev force-pushed the ac-decimal/73487-pt4 branch from bae6e79 to b778703 Compare August 19, 2025 09:43
@skirpichev
skirpichev requested a review from serhiy-storchaka August 19, 2025 10:10
@skirpichev
Merge branch 'master' into ac-decimal/73487-pt4
d944c4d
@skirpichev

This comment was marked as outdated.

Sign in to view
@skirpichev
address review: revert macro changes
aa29186
@skirpichev

skirpichev commented Aug 20, 2025

Copy link
Copy Markdown
Member 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

serhiy-storchaka
serhiy-storchaka approved these changes Aug 20, 2025
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM. 👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Aug 20, 2025
AA-Turner
AA-Turner approved these changes Aug 20, 2025
View reviewed changes
@AA-Turner

AA-Turner commented Aug 20, 2025

Copy link
Copy Markdown
Member

Thanks!

A

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner
AA-Turner merged commit c056a08 into python:main Aug 20, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Aug 20, 2025
@skirpichev
skirpichev deleted the ac-decimal/73487-pt4 branch August 20, 2025 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes
@AA-Turner AA-Turner AA-Turner approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news topic-argument-clinic

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@skirpichev @AA-Turner @serhiy-storchaka
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.