@@ -3921,6 +3921,7 @@ _decimal_Decimal_as_integer_ratio_impl(PyObject *self)
3921
3921
/*[clinic input]
3922
3922
_decimal.Decimal.to_integral_value
3923
3923
3924
+ self as dec: self
3924
3925
rounding: object = None
3925
3926
context: object = None
3926
3927
@@ -3932,15 +3933,15 @@ the current default context is used.
3932
3933
[clinic start generated code]*/
3933
3934
3934
3935
static PyObject *
3935
- _decimal_Decimal_to_integral_value_impl (PyObject * self , PyObject * rounding ,
3936
+ _decimal_Decimal_to_integral_value_impl (PyObject * dec , PyObject * rounding ,
3936
3937
PyObject * context )
3937
- /*[clinic end generated code: output=7301465765f48b6b input=5778168222cadf71 ]*/
3938
+ /*[clinic end generated code: output=1517d948029dbecc input=0fd8dd3bc5248b21 ]*/
3938
3939
{
3939
3940
PyObject * result ;
3940
3941
uint32_t status = 0 ;
3941
3942
mpd_context_t workctx ;
3942
3943
3943
- decimal_state * state = get_module_state_by_def (Py_TYPE (self ));
3944
+ decimal_state * state = get_module_state_by_def (Py_TYPE (dec ));
3944
3945
CONTEXT_CHECK_VA (state , context );
3945
3946
3946
3947
workctx = * CTX (context );
@@ -3959,7 +3960,7 @@ _decimal_Decimal_to_integral_value_impl(PyObject *self, PyObject *rounding,
3959
3960
return NULL ;
3960
3961
}
3961
3962
3962
- mpd_qround_to_int (MPD (result ), MPD (self ), & workctx , & status );
3963
+ mpd_qround_to_int (MPD (result ), MPD (dec ), & workctx , & status );
3963
3964
if (dec_addstatus (context , status )) {
3964
3965
Py_DECREF (result );
3965
3966
return NULL ;
@@ -3990,6 +3991,7 @@ _decimal_Decimal_to_integral_impl(PyObject *self, PyObject *rounding,
3990
3991
/*[clinic input]
3991
3992
_decimal.Decimal.to_integral_exact
3992
3993
3994
+ self as dec: self
3993
3995
rounding: object = None
3994
3996
context: object = None
3995
3997
@@ -4002,15 +4004,15 @@ rounding mode of the current default context is used.
4002
4004
[clinic start generated code]*/
4003
4005
4004
4006
static PyObject *
4005
- _decimal_Decimal_to_integral_exact_impl (PyObject * self , PyObject * rounding ,
4007
+ _decimal_Decimal_to_integral_exact_impl (PyObject * dec , PyObject * rounding ,
4006
4008
PyObject * context )
4007
- /*[clinic end generated code: output=8b004f9b45ac7746 input=edd30a9f06aed70b ]*/
4009
+ /*[clinic end generated code: output=bfcd6d3ac47460d7 input=095a7cc7368dcfbb ]*/
4008
4010
{
4009
4011
PyObject * result ;
4010
4012
uint32_t status = 0 ;
4011
4013
mpd_context_t workctx ;
4012
4014
4013
- decimal_state * state = get_module_state_by_def (Py_TYPE (self ));
4015
+ decimal_state * state = get_module_state_by_def (Py_TYPE (dec ));
4014
4016
CONTEXT_CHECK_VA (state , context );
4015
4017
4016
4018
workctx = * CTX (context );
@@ -4029,7 +4031,7 @@ _decimal_Decimal_to_integral_exact_impl(PyObject *self, PyObject *rounding,
4029
4031
return NULL ;
4030
4032
}
4031
4033
4032
- mpd_qround_to_intx (MPD (result ), MPD (self ), & workctx , & status );
4034
+ mpd_qround_to_intx (MPD (result ), MPD (dec ), & workctx , & status );
4033
4035
if (dec_addstatus (context , status )) {
4034
4036
Py_DECREF (result );
4035
4037
return NULL ;
@@ -4123,12 +4125,14 @@ PyDec_Round(PyObject *dec, PyObject *args)
4123
4125
/*[clinic input]
4124
4126
_decimal.Decimal.as_tuple
4125
4127
4128
+ self as dec: self
4129
+
4126
4130
Return a tuple representation of the number.
4127
4131
[clinic start generated code]*/
4128
4132
4129
4133
static PyObject *
4130
- _decimal_Decimal_as_tuple_impl (PyObject * self )
4131
- /*[clinic end generated code: output=c6e8e2420c515eca input=e26f2151d78ff59d ]*/
4134
+ _decimal_Decimal_as_tuple_impl (PyObject * dec )
4135
+ /*[clinic end generated code: output=b1a619dfdbf89220 input=e334c01206f0e62e ]*/
4132
4136
{
4133
4137
PyObject * result = NULL ;
4134
4138
PyObject * sign = NULL ;
@@ -4140,13 +4144,13 @@ _decimal_Decimal_as_tuple_impl(PyObject *self)
4140
4144
Py_ssize_t intlen , i ;
4141
4145
4142
4146
4143
- x = mpd_qncopy (MPD (self ));
4147
+ x = mpd_qncopy (MPD (dec ));
4144
4148
if (x == NULL ) {
4145
4149
PyErr_NoMemory ();
4146
4150
goto out ;
4147
4151
}
4148
4152
4149
- sign = PyLong_FromUnsignedLong (mpd_sign (MPD (self )));
4153
+ sign = PyLong_FromUnsignedLong (mpd_sign (MPD (dec )));
4150
4154
if (sign == NULL ) {
4151
4155
goto out ;
4152
4156
}
@@ -4167,7 +4171,7 @@ _decimal_Decimal_as_tuple_impl(PyObject *self)
4167
4171
expt = PyUnicode_FromString (mpd_isqnan (x )?"n" :"N" );
4168
4172
}
4169
4173
else {
4170
- expt = PyLong_FromSsize_t (MPD (self )-> exp );
4174
+ expt = PyLong_FromSsize_t (MPD (dec )-> exp );
4171
4175
}
4172
4176
if (expt == NULL ) {
4173
4177
goto out ;
@@ -4208,7 +4212,7 @@ _decimal_Decimal_as_tuple_impl(PyObject *self)
4208
4212
}
4209
4213
}
4210
4214
4211
- decimal_state * state = get_module_state_by_def (Py_TYPE (self ));
4215
+ decimal_state * state = get_module_state_by_def (Py_TYPE (dec ));
4212
4216
result = PyObject_CallFunctionObjArgs ((PyObject * )state -> DecimalTuple ,
4213
4217
sign , coeff , expt , NULL );
4214
4218
@@ -4930,6 +4934,7 @@ Dec_BinaryFuncVA(mpd_qshift)
4930
4934
/*[clinic input]
4931
4935
_decimal.Decimal.quantize
4932
4936
4937
+ self as v: self
4933
4938
exp as w: object
4934
4939
rounding: object = None
4935
4940
context: object = None
@@ -4954,16 +4959,16 @@ argument is given, the rounding mode of the current thread's context is used.
4954
4959
[clinic start generated code]*/
4955
4960
4956
4961
static PyObject *
4957
- _decimal_Decimal_quantize_impl (PyObject * self , PyObject * w ,
4958
- PyObject * rounding , PyObject * context )
4959
- /*[clinic end generated code: output=5e84581f96dc685c input=2053ebf488a665dc ]*/
4962
+ _decimal_Decimal_quantize_impl (PyObject * v , PyObject * w , PyObject * rounding ,
4963
+ PyObject * context )
4964
+ /*[clinic end generated code: output=6ebc907ee3000c1f input=223b9dd92655b4bd ]*/
4960
4965
{
4961
4966
PyObject * a , * b ;
4962
4967
PyObject * result ;
4963
4968
uint32_t status = 0 ;
4964
4969
mpd_context_t workctx ;
4965
4970
4966
- decimal_state * state = get_module_state_by_def (Py_TYPE (self ));
4971
+ decimal_state * state = get_module_state_by_def (Py_TYPE (v ));
4967
4972
CONTEXT_CHECK_VA (state , context );
4968
4973
4969
4974
workctx = * CTX (context );
@@ -4977,7 +4982,7 @@ _decimal_Decimal_quantize_impl(PyObject *self, PyObject *w,
4977
4982
}
4978
4983
}
4979
4984
4980
- CONVERT_BINOP_RAISE (& a , & b , self , w , context );
4985
+ CONVERT_BINOP_RAISE (& a , & b , v , w , context );
4981
4986
4982
4987
result = dec_alloc (state );
4983
4988
if (result == NULL ) {
0 commit comments