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
Code line content in this commit was purged after it aged past our code retention window of two weeks for this repo. We have insufficient quota to grab the code content at this time, please try back later.

If you receive this message over several days, please consider adding more users to your account (whose quota we can use to grab commit content), or contact [email protected] with error #33NFNE
Diff Delta:
285
About 15 Diff Delta/hour
Classified as:  Feature Add

cmaloney's Description of Work

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 -->

15 total changed files
(2 files ignored)
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
That’s the last hunk
Reviewer: 1. Additional work: 0