@@ -3173,7 +3173,7 @@ PyDec_FromObject(PyObject *v, PyObject *context)
3173
3173
@classmethod
3174
3174
_decimal.Decimal.__new__ as dec_new
3175
3175
3176
- value as v : object(c_default="NULL") = "0"
3176
+ value: object(c_default="NULL") = "0"
3177
3177
context: object = None
3178
3178
3179
3179
Construct a new Decimal object.
@@ -3185,13 +3185,13 @@ trap is active.
3185
3185
[clinic start generated code]*/
3186
3186
3187
3187
static 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 ]*/
3190
3190
{
3191
3191
decimal_state * state = get_module_state_by_def (type );
3192
3192
CONTEXT_CHECK_VA (state , context );
3193
3193
3194
- return PyDecType_FromObjectExact (type , v , context );
3194
+ return PyDecType_FromObjectExact (type , value , context );
3195
3195
}
3196
3196
3197
3197
static PyObject *
@@ -4136,33 +4136,32 @@ PyDec_AsFloat(PyObject *dec)
4136
4136
/*[clinic input]
4137
4137
_decimal.Decimal.__round__
4138
4138
4139
- self as dec: self
4140
4139
ndigits as x: object(c_default="NULL") = None
4141
4140
4142
4141
Return the Integral closest to self, rounding half toward even.
4143
4142
[clinic start generated code]*/
4144
4143
4145
4144
static 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 ]*/
4148
4147
{
4149
4148
PyObject * result ;
4150
4149
uint32_t status = 0 ;
4151
4150
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 ));
4153
4152
CURRENT_CONTEXT (state , context );
4154
- if (x ) {
4153
+ if (ndigits ) {
4155
4154
mpd_uint_t dq [1 ] = {1 };
4156
4155
mpd_t q = {MPD_STATIC |MPD_CONST_DATA ,0 ,1 ,1 ,1 ,dq };
4157
4156
mpd_ssize_t y ;
4158
4157
4159
- if (!PyLong_Check (x )) {
4158
+ if (!PyLong_Check (ndigits )) {
4160
4159
PyErr_SetString (PyExc_TypeError ,
4161
4160
"optional arg must be an integer" );
4162
4161
return NULL ;
4163
4162
}
4164
4163
4165
- y = PyLong_AsSsize_t (x );
4164
+ y = PyLong_AsSsize_t (ndigits );
4166
4165
if (y == -1 && PyErr_Occurred ()) {
4167
4166
return NULL ;
4168
4167
}
@@ -4172,7 +4171,7 @@ _decimal_Decimal___round___impl(PyObject *dec, PyObject *x)
4172
4171
}
4173
4172
4174
4173
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 );
4176
4175
if (dec_addstatus (context , status )) {
4177
4176
Py_DECREF (result );
4178
4177
return NULL ;
@@ -4181,7 +4180,7 @@ _decimal_Decimal___round___impl(PyObject *dec, PyObject *x)
4181
4180
return result ;
4182
4181
}
4183
4182
else {
4184
- return dec_as_long (dec , context , MPD_ROUND_HALF_EVEN );
4183
+ return dec_as_long (self , context , MPD_ROUND_HALF_EVEN );
4185
4184
}
4186
4185
}
4187
4186
@@ -6150,7 +6149,7 @@ ctx_##MPDFUNC(PyObject *context, PyObject *args) \
6150
6149
PyObject *result; \
6151
6150
uint32_t status = 0; \
6152
6151
\
6153
- CONVERT_TERNOP_RAISE(&a, &b, &c, v, w, x , context); \
6152
+ CONVERT_TERNOP_RAISE(&a, &b, &c, x, y, z , context); \
6154
6153
decimal_state *state = get_module_state_from_ctx(context); \
6155
6154
if ((result = dec_alloc(state)) == NULL) { \
6156
6155
Py_DECREF(a); \
@@ -6327,18 +6326,18 @@ _decimal_Context_power_impl(PyObject *context, PyObject *base, PyObject *exp,
6327
6326
_decimal.Context.fma
6328
6327
6329
6328
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
6333
6332
/
6334
6333
6335
6334
Return x multiplied by y, plus z.
6336
6335
[clinic start generated code]*/
6337
6336
6338
6337
static 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 ]*/
6342
6341
DecCtx_TernaryFunc (mpd_qfma )
6343
6342
6344
6343
/* No argument */
0 commit comments