Skip to content

Commit ec221f1

Browse files
committed
Revert "address review: rename some self"
This reverts commit 8b757da.
1 parent ab62391 commit ec221f1

File tree

2 files changed

+33
-38
lines changed

2 files changed

+33
-38
lines changed

Modules/_decimal/_decimal.c

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3915,7 +3915,6 @@ _decimal_Decimal_as_integer_ratio_impl(PyObject *self)
39153915
/*[clinic input]
39163916
_decimal.Decimal.to_integral_value
39173917
3918-
self as dec: self
39193918
rounding: object = None
39203919
context: object = None
39213920
@@ -3927,15 +3926,15 @@ rounding mode of the current default context is used.
39273926
[clinic start generated code]*/
39283927

39293928
static PyObject *
3930-
_decimal_Decimal_to_integral_value_impl(PyObject *dec, PyObject *rounding,
3929+
_decimal_Decimal_to_integral_value_impl(PyObject *self, PyObject *rounding,
39313930
PyObject *context)
3932-
/*[clinic end generated code: output=1517d948029dbecc input=0afac3e278bdb511]*/
3931+
/*[clinic end generated code: output=7301465765f48b6b input=04e2312d5ed19f77]*/
39333932
{
39343933
PyObject *result;
39353934
uint32_t status = 0;
39363935
mpd_context_t workctx;
39373936

3938-
decimal_state *state = get_module_state_by_def(Py_TYPE(dec));
3937+
decimal_state *state = get_module_state_by_def(Py_TYPE(self));
39393938
CONTEXT_CHECK_VA(state, context);
39403939

39413940
workctx = *CTX(context);
@@ -3954,7 +3953,7 @@ _decimal_Decimal_to_integral_value_impl(PyObject *dec, PyObject *rounding,
39543953
return NULL;
39553954
}
39563955

3957-
mpd_qround_to_int(MPD(result), MPD(dec), &workctx, &status);
3956+
mpd_qround_to_int(MPD(result), MPD(self), &workctx, &status);
39583957
if (dec_addstatus(context, status)) {
39593958
Py_DECREF(result);
39603959
return NULL;
@@ -3986,7 +3985,6 @@ _decimal_Decimal_to_integral_impl(PyObject *self, PyObject *rounding,
39863985
/*[clinic input]
39873986
_decimal.Decimal.to_integral_exact
39883987
3989-
self as dec: self
39903988
rounding: object = None
39913989
context: object = None
39923990
@@ -3999,15 +3997,15 @@ given, then the rounding mode of the current default context is used.
39993997
[clinic start generated code]*/
40003998

40013999
static PyObject *
4002-
_decimal_Decimal_to_integral_exact_impl(PyObject *dec, PyObject *rounding,
4000+
_decimal_Decimal_to_integral_exact_impl(PyObject *self, PyObject *rounding,
40034001
PyObject *context)
4004-
/*[clinic end generated code: output=bfcd6d3ac47460d7 input=8cb083bc2b4fb1c3]*/
4002+
/*[clinic end generated code: output=8b004f9b45ac7746 input=c290166f59c1d6ab]*/
40054003
{
40064004
PyObject *result;
40074005
uint32_t status = 0;
40084006
mpd_context_t workctx;
40094007

4010-
decimal_state *state = get_module_state_by_def(Py_TYPE(dec));
4008+
decimal_state *state = get_module_state_by_def(Py_TYPE(self));
40114009
CONTEXT_CHECK_VA(state, context);
40124010

40134011
workctx = *CTX(context);
@@ -4026,7 +4024,7 @@ _decimal_Decimal_to_integral_exact_impl(PyObject *dec, PyObject *rounding,
40264024
return NULL;
40274025
}
40284026

4029-
mpd_qround_to_intx(MPD(result), MPD(dec), &workctx, &status);
4027+
mpd_qround_to_intx(MPD(result), MPD(self), &workctx, &status);
40304028
if (dec_addstatus(context, status)) {
40314029
Py_DECREF(result);
40324030
return NULL;
@@ -4118,14 +4116,12 @@ PyDec_Round(PyObject *dec, PyObject *args)
41184116
/*[clinic input]
41194117
_decimal.Decimal.as_tuple
41204118
4121-
self as dec: self
4122-
41234119
Return a tuple representation of the number.
41244120
[clinic start generated code]*/
41254121

41264122
static PyObject *
4127-
_decimal_Decimal_as_tuple_impl(PyObject *dec)
4128-
/*[clinic end generated code: output=b1a619dfdbf89220 input=e334c01206f0e62e]*/
4123+
_decimal_Decimal_as_tuple_impl(PyObject *self)
4124+
/*[clinic end generated code: output=c6e8e2420c515eca input=e26f2151d78ff59d]*/
41294125
{
41304126
PyObject *result = NULL;
41314127
PyObject *sign = NULL;
@@ -4137,13 +4133,13 @@ _decimal_Decimal_as_tuple_impl(PyObject *dec)
41374133
Py_ssize_t intlen, i;
41384134

41394135

4140-
x = mpd_qncopy(MPD(dec));
4136+
x = mpd_qncopy(MPD(self));
41414137
if (x == NULL) {
41424138
PyErr_NoMemory();
41434139
goto out;
41444140
}
41454141

4146-
sign = PyLong_FromUnsignedLong(mpd_sign(MPD(dec)));
4142+
sign = PyLong_FromUnsignedLong(mpd_sign(MPD(self)));
41474143
if (sign == NULL) {
41484144
goto out;
41494145
}
@@ -4164,7 +4160,7 @@ _decimal_Decimal_as_tuple_impl(PyObject *dec)
41644160
expt = PyUnicode_FromString(mpd_isqnan(x)?"n":"N");
41654161
}
41664162
else {
4167-
expt = PyLong_FromSsize_t(MPD(dec)->exp);
4163+
expt = PyLong_FromSsize_t(MPD(self)->exp);
41684164
}
41694165
if (expt == NULL) {
41704166
goto out;
@@ -4205,7 +4201,7 @@ _decimal_Decimal_as_tuple_impl(PyObject *dec)
42054201
}
42064202
}
42074203

4208-
decimal_state *state = get_module_state_by_def(Py_TYPE(dec));
4204+
decimal_state *state = get_module_state_by_def(Py_TYPE(self));
42094205
result = PyObject_CallFunctionObjArgs((PyObject *)state->DecimalTuple,
42104206
sign, coeff, expt, NULL);
42114207

@@ -4934,7 +4930,6 @@ Dec_BinaryFuncVA(mpd_qshift)
49344930
/*[clinic input]
49354931
_decimal.Decimal.quantize
49364932
4937-
self as v: self
49384933
exp as w: object
49394934
rounding: object = None
49404935
context: object = None
@@ -4964,16 +4959,16 @@ current thread's context is used.
49644959
[clinic start generated code]*/
49654960

49664961
static PyObject *
4967-
_decimal_Decimal_quantize_impl(PyObject *v, PyObject *w, PyObject *rounding,
4968-
PyObject *context)
4969-
/*[clinic end generated code: output=6ebc907ee3000c1f input=d1dc20057afe0c7e]*/
4962+
_decimal_Decimal_quantize_impl(PyObject *self, PyObject *w,
4963+
PyObject *rounding, PyObject *context)
4964+
/*[clinic end generated code: output=5e84581f96dc685c input=4c7d28d36948e9aa]*/
49704965
{
49714966
PyObject *a, *b;
49724967
PyObject *result;
49734968
uint32_t status = 0;
49744969
mpd_context_t workctx;
49754970

4976-
decimal_state *state = get_module_state_by_def(Py_TYPE(v));
4971+
decimal_state *state = get_module_state_by_def(Py_TYPE(self));
49774972
CONTEXT_CHECK_VA(state, context);
49784973

49794974
workctx = *CTX(context);
@@ -4987,7 +4982,7 @@ _decimal_Decimal_quantize_impl(PyObject *v, PyObject *w, PyObject *rounding,
49874982
}
49884983
}
49894984

4990-
CONVERT_BINOP_RAISE(&a, &b, v, w, context);
4985+
CONVERT_BINOP_RAISE(&a, &b, self, w, context);
49914986

49924987
result = dec_alloc(state);
49934988
if (result == NULL) {

Modules/_decimal/clinic/_decimal.c.h

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

0 commit comments

Comments
 (0)