gh-87613: Allow Argument Clinic vectorcall on heap types #160115

Merged
cmaloney opened 3:46pm on October 21, 2026 wanted to merge 285 Ξ” into python/cpython main from
gh-150097-clinic-vectorcall-heaptype

Pull Request Overview

  • Opened on October 21, 2026
  • Status Merged
  • Commit count 4 with first commit October 21, 2026

Total Delta

285 Total Diff Delta

Open Days

Open 23 weekdays

Test Delta

131 Diff Delta in Test Files
Breakdown by Phase

How long has this pull request spent in each phase of its lifecycle?

Fraction of total time Business days Phase
 
0.3 days Authoring 1 commit before pull request opened for review
 
0.4 days Awaiting first review
 
1.0 day Revising work with 3 commits in response to 5 reviews that left 10 comments
 
21.0 days Merge to deploy (still awaiting deployment)

Total time for pull request 1.7 business days from first commit authored to merge
Still awaiting deployment

Author avatar

gh-87613: Allow Argument Clinic vectorcall on heap types

decimal.Decimal is a heap type that would like to use AC Vectorcall. Heap types have no static type object so switch from Py_Is to an assert that the shadowed tp_new / tp_init function is the expected one to validate the vectorcall is ony used with the exact function it is providing a "vector" option for.

Heap types can have zero-argument __new__ and __init__ so add support for that producing the same error message via a new helper _PyArg_NoPositionalStack().

--
Minified from GH-157968. This does not use Py_tp_token as that only exists on Heap objects and want both static and heap objects to work with the same code.


  • Issue: gh-87613
    <!-- /gh-issue-number -->

Comments Threads Pending Resolution

vstinner reviewed on October 23, 2026
vstinner reviewed on October 22, 2026
vstinner left a comment

LGTM if you revert the _decimal change.

Resolved Comment Threads

vstinner reviewed and approved this work on October 23, 2026
vstinner left a comment

LGTM

skirpichev reviewed on October 22, 2026
vstinner reviewed on October 22, 2026
vstinner left a comment

LGTM if you revert the _decimal change.

Modules/_decimal/_decimal.c
Outdated