@@ -3173,7 +3173,7 @@ PyDec_FromObject(PyObject *v, PyObject *context)
31733173@classmethod
31743174_decimal.Decimal.__new__ as dec_new
31753175
3176- value as v : object(c_default="NULL") = "0"
3176+ value: object(c_default="NULL") = "0"
31773177 context: object = None
31783178
31793179Construct a new Decimal object.
@@ -3185,13 +3185,13 @@ trap is active.
31853185[clinic start generated code]*/
31863186
31873187static PyObject *
3188- dec_new_impl (PyTypeObject * type , PyObject * v , PyObject * context )
3189- /*[clinic end generated code: output=5371cbce41508fe7 input=6353a3563bea247b ]*/
3188+ dec_new_impl (PyTypeObject * type , PyObject * value , PyObject * context )
3189+ /*[clinic end generated code: output=35f48a40c65625ba input=5f8a0892d3fcef80 ]*/
31903190{
31913191 decimal_state * state = get_module_state_by_def (type );
31923192 CONTEXT_CHECK_VA (state , context );
31933193
3194- return PyDecType_FromObjectExact (type , v , context );
3194+ return PyDecType_FromObjectExact (type , value , context );
31953195}
31963196
31973197static PyObject *
@@ -4136,33 +4136,32 @@ PyDec_AsFloat(PyObject *dec)
41364136/*[clinic input]
41374137_decimal.Decimal.__round__
41384138
4139- self as dec: self
41404139 ndigits as x: object(c_default="NULL") = None
41414140
41424141Return the Integral closest to self, rounding half toward even.
41434142[clinic start generated code]*/
41444143
41454144static PyObject *
4146- _decimal_Decimal___round___impl (PyObject * dec , PyObject * x )
4147- /*[clinic end generated code: output=5089b98ed18bb5e3 input=a3986615e1ad5b2a ]*/
4145+ _decimal_Decimal___round___impl (PyObject * self , PyObject * x )
4146+ /*[clinic end generated code: output=fd6827cea496a5e2 input=1e397f40af98f1c4 ]*/
41484147{
41494148 PyObject * result ;
41504149 uint32_t status = 0 ;
41514150 PyObject * context ;
4152- decimal_state * state = get_module_state_by_def (Py_TYPE (dec ));
4151+ decimal_state * state = get_module_state_by_def (Py_TYPE (self ));
41534152 CURRENT_CONTEXT (state , context );
4154- if (x ) {
4153+ if (ndigits ) {
41554154 mpd_uint_t dq [1 ] = {1 };
41564155 mpd_t q = {MPD_STATIC |MPD_CONST_DATA ,0 ,1 ,1 ,1 ,dq };
41574156 mpd_ssize_t y ;
41584157
4159- if (!PyLong_Check (x )) {
4158+ if (!PyLong_Check (ndigits )) {
41604159 PyErr_SetString (PyExc_TypeError ,
41614160 "optional arg must be an integer" );
41624161 return NULL ;
41634162 }
41644163
4165- y = PyLong_AsSsize_t (x );
4164+ y = PyLong_AsSsize_t (ndigits );
41664165 if (y == -1 && PyErr_Occurred ()) {
41674166 return NULL ;
41684167 }
@@ -4172,7 +4171,7 @@ _decimal_Decimal___round___impl(PyObject *dec, PyObject *x)
41724171 }
41734172
41744173 q .exp = (y == MPD_SSIZE_MIN ) ? MPD_SSIZE_MAX : - y ;
4175- mpd_qquantize (MPD (result ), MPD (dec ), & q , CTX (context ), & status );
4174+ mpd_qquantize (MPD (result ), MPD (self ), & q , CTX (context ), & status );
41764175 if (dec_addstatus (context , status )) {
41774176 Py_DECREF (result );
41784177 return NULL ;
@@ -4181,7 +4180,7 @@ _decimal_Decimal___round___impl(PyObject *dec, PyObject *x)
41814180 return result ;
41824181 }
41834182 else {
4184- return dec_as_long (dec , context , MPD_ROUND_HALF_EVEN );
4183+ return dec_as_long (self , context , MPD_ROUND_HALF_EVEN );
41854184 }
41864185}
41874186
@@ -6150,7 +6149,7 @@ ctx_##MPDFUNC(PyObject *context, PyObject *args) \
61506149 PyObject *result; \
61516150 uint32_t status = 0; \
61526151 \
6153- CONVERT_TERNOP_RAISE(&a, &b, &c, v, w, x , context); \
6152+ CONVERT_TERNOP_RAISE(&a, &b, &c, x, y, z , context); \
61546153 decimal_state *state = get_module_state_from_ctx(context); \
61556154 if ((result = dec_alloc(state)) == NULL) { \
61566155 Py_DECREF(a); \
@@ -6327,18 +6326,18 @@ _decimal_Context_power_impl(PyObject *context, PyObject *base, PyObject *exp,
63276326_decimal.Context.fma
63286327
63296328 self as context: self
6330- x as v : object
6331- y as w : object
6332- z as x : object
6329+ x: object
6330+ y: object
6331+ z: object
63336332 /
63346333
63356334Return x multiplied by y, plus z.
63366335[clinic start generated code]*/
63376336
63386337static PyObject *
6339- _decimal_Context_fma_impl (PyObject * context , PyObject * v , PyObject * w ,
6340- PyObject * x )
6341- /*[clinic end generated code: output=0664d24f7e4b4aac input=9f3abeaa9a47ea61 ]*/
6338+ _decimal_Context_fma_impl (PyObject * context , PyObject * x , PyObject * y ,
6339+ PyObject * z )
6340+ /*[clinic end generated code: output=2d6174716faaf4e1 input=80479612da3333d1 ]*/
63426341DecCtx_TernaryFunc (mpd_qfma )
63436342
63446343/* No argument */
0 commit comments