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 7) by skirpichev · Pull Request #138221 · python/cpython

Conversation

@skirpichev

@skirpichev skirpichev commented Aug 28, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • use "defining class" converter, where possible
  • convert Context._unsafe* to Argument Clinic
  • Issue: decimal: Use Argument Clinic #73487

Sorry, something went wrong.

Uh oh!

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

All reactions
@skirpichev
pythongh-73487: Convert _decimal to use Argument Clinic (part 7)
860a942
Use "defining class" converter, where possible.
@bedevere-app bedevere-app Bot mentioned this pull request Aug 28, 2025
decimal: Use Argument Clinic #73487
Closed
@skirpichev skirpichev added the skip news label Aug 28, 2025
@skirpichev
skirpichev requested review from AA-Turner and serhiy-storchaka and removed request for AA-Turner August 28, 2025 11:40
serhiy-storchaka
serhiy-storchaka reviewed Aug 28, 2025
View reviewed changes
Comment thread Modules/_decimal/_decimal.c Resolved

Uh oh!

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

@skirpichev
+1
c7f9471
@skirpichev
skirpichev force-pushed the ac-decimal/73487-pt7 branch from b335e44 to c7f9471 Compare August 28, 2025 13:21
skirpichev added 2 commits August 28, 2025 16:23
@skirpichev
convert Context._unsafe* to Argument Clinic
d02e916
@skirpichev
+ more "defining class"
d18f805
@skirpichev
skirpichev requested a review from serhiy-storchaka August 28, 2025 14:23
@skirpichev
skirpichev marked this pull request as ready for review August 28, 2025 14:23
@bedevere-app bedevere-app Bot added the awaiting review label Aug 28, 2025
serhiy-storchaka
serhiy-storchaka reviewed Aug 28, 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.

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
address review: update comments
31fa34f
@skirpichev
skirpichev requested a review from serhiy-storchaka August 29, 2025 00:44
AA-Turner
AA-Turner approved these changes Sep 1, 2025
View reviewed changes

@AA-Turner AA-Turner 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.

Looks ok from a desk review, barring Serhiy's comments.

A

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 Sep 1, 2025
@AA-Turner AA-Turner changed the title gh-73487: Convert _decimal to use Argument Clinic (part 7) gh-73487: Convert _decimal to use Argument Clinic (part 7) Sep 1, 2025
serhiy-storchaka
serhiy-storchaka reviewed Sep 2, 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.

Are there any uses of get_module_state_by_def() left?

Sorry, something went wrong.

Uh oh!

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

All reactions
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.

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 added 3 commits September 2, 2025 11:08
@skirpichev
Merge branch 'master' into ac-decimal/73487-pt7
379ee7f
@skirpichev
address review: minor fixes
6628819
@skirpichev
address review: refactor context_copy()
1fa30dc
@skirpichev

skirpichev commented Sep 2, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Are there any uses of get_module_state_by_def() left?

Yes, a lot:

$ git grep get_module_state_by_def Modules/_decimal
Modules/_decimal/_decimal.c:get_module_state_by_def(PyTypeObject *tp)
Modules/_decimal/_decimal.c:    decimal_state *state = get_module_state_by_def(Py_TYPE(self));
Modules/_decimal/_decimal.c:    decimal_state *state = get_module_state_by_def(Py_TYPE(self));
Modules/_decimal/_decimal.c:    decimal_state *state = get_module_state_by_def(Py_TYPE(self));
Modules/_decimal/_decimal.c:    decimal_state *state = get_module_state_by_def(Py_TYPE(self));
Modules/_decimal/_decimal.c:    decimal_state *state = get_module_state_by_def(Py_TYPE(v));
Modules/_decimal/_decimal.c:    decimal_state *state = get_module_state_by_def(Py_TYPE(self));
Modules/_decimal/_decimal.c:    decimal_state *state = get_module_state_by_def(type);
Modules/_decimal/_decimal.c:    decimal_state *state = get_module_state_by_def(type);
Modules/_decimal/_decimal.c:    decimal_state *state = get_module_state_by_def(Py_TYPE(dec));
Modules/_decimal/_decimal.c:    decimal_state *state = get_module_state_by_def(Py_TYPE(dec));
Modules/_decimal/_decimal.c:    decimal_state *state = get_module_state_by_def(Py_TYPE(self));
Modules/_decimal/_decimal.c:    decimal_state *state = get_module_state_by_def(Py_TYPE(self));   \
Modules/_decimal/_decimal.c:    decimal_state *state = get_module_state_by_def(Py_TYPE(dec));
Modules/_decimal/_decimal.c:    decimal_state *state = get_module_state_by_def(Py_TYPE(self));

I'll double check, some case could be converted to use "defining class" converter (e.g. _decimal.Decimal.as_tuple), but not all.

Edit: I think nothing left.

All reactions

Sorry, something went wrong.

Uh oh!

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

@skirpichev
address review: convert as_tuple to use defining_class converter
a0f562b
@skirpichev
skirpichev requested a review from serhiy-storchaka September 2, 2025 09:10
@skirpichev

skirpichev commented Sep 10, 2025

Copy link
Copy Markdown
Member Author

@serhiy-storchaka, do you think anything left to address issue?

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 Sep 10, 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.

Minor question, and LGTM. 👍

Sorry, something went wrong.

Uh oh!

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

All reactions
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 added 3 commits September 10, 2025 11:05
@skirpichev
address review: fix typo
fd960d4
@skirpichev
address review: reorder args of context_copy()
e938880
@skirpichev
Merge branch 'master' into ac-decimal/73487-pt7
d7f9407
serhiy-storchaka
serhiy-storchaka approved these changes Sep 10, 2025
View reviewed changes
vstinner
vstinner approved these changes Sep 18, 2025
View reviewed changes

@vstinner vstinner 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
@vstinner
vstinner merged commit b0a8073 into python:main Sep 18, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Sep 18, 2025
@vstinner

vstinner commented Sep 18, 2025

Copy link
Copy Markdown
Member

Merged, thanks.

All reactions

Sorry, something went wrong.

Uh oh!

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

@skirpichev
skirpichev deleted the ac-decimal/73487-pt7 branch September 18, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes
@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

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.

4 participants

@skirpichev @vstinner @serhiy-storchaka @AA-Turner
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 01402520 — 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.