Skip to content

Commit 1ce0827

Browse files
cmaloneyclaude
andcommitted
gh-87613: Use Argument Clinic @vectorcall for decimal.Decimal
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 7ef8883 commit 1ce0827

2 files changed

Lines changed: 49 additions & 6 deletions

File tree

‎Modules/_decimal/_decimal.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3314,6 +3314,7 @@ PyDec_FromObject(PyObject *v, PyObject *context)
33143314

33153315
/*[clinic input]
33163316
@classmethod
3317+
@vectorcall
33173318
_decimal.Decimal.__new__ as dec_new
33183319
33193320
value: object(c_default="NULL") = "0"
@@ -3329,7 +3330,7 @@ trap is active.
33293330

33303331
static PyObject *
33313332
dec_new_impl(PyTypeObject *type, PyObject *value, PyObject *context)
3332-
/*[clinic end generated code: output=35f48a40c65625ba input=5f8a0892d3fcef80]*/
3333+
/*[clinic end generated code: output=35f48a40c65625ba input=dd1efa0c0ffe9416]*/
33333334
{
33343335
decimal_state *state = get_module_state_by_def(type);
33353336
CONTEXT_CHECK_VA(state, context);
@@ -6190,6 +6191,7 @@ static PyType_Slot dec_slots[] = {
61906191
{Py_tp_methods, dec_methods},
61916192
{Py_tp_getset, dec_getsets},
61926193
{Py_tp_new, dec_new},
6194+
{Py_tp_vectorcall, dec_vectorcall},
61936195

61946196
// Number protocol
61956197
{Py_nb_add, nm_mpd_qadd},

‎Modules/_decimal/clinic/_decimal.c.h‎

Lines changed: 46 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)