Skip to content

Commit d78a97f

Browse files
committed
address review: move to_integral_value around
1 parent 354d8db commit d78a97f

File tree

2 files changed

+65
-65
lines changed

2 files changed

+65
-65
lines changed

Modules/_decimal/_decimal.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3919,20 +3919,22 @@ _decimal_Decimal_as_integer_ratio_impl(PyObject *self)
39193919
}
39203920

39213921
/*[clinic input]
3922-
_decimal.Decimal.to_integral
3922+
_decimal.Decimal.to_integral_value
39233923
39243924
rounding: object = None
39253925
context: object = None
39263926
3927-
Identical to the to_integral_value() method.
3927+
Round to the nearest integer without signaling Inexact or Rounded.
39283928
3929-
The to_integral() name has been kept for compatibility with older versions.
3929+
The rounding mode is determined by the rounding parameter if given, else by
3930+
the given context. If neither parameter is given, then the rounding mode of
3931+
the current default context is used.
39303932
[clinic start generated code]*/
39313933

39323934
static PyObject *
3933-
_decimal_Decimal_to_integral_impl(PyObject *self, PyObject *rounding,
3934-
PyObject *context)
3935-
/*[clinic end generated code: output=a0c7188686ee7f5c input=a57d62d1d29aed1b]*/
3935+
_decimal_Decimal_to_integral_value_impl(PyObject *self, PyObject *rounding,
3936+
PyObject *context)
3937+
/*[clinic end generated code: output=7301465765f48b6b input=5778168222cadf71]*/
39363938
{
39373939
PyObject *result;
39383940
uint32_t status = 0;
@@ -3966,6 +3968,25 @@ _decimal_Decimal_to_integral_impl(PyObject *self, PyObject *rounding,
39663968
return result;
39673969
}
39683970

3971+
/*[clinic input]
3972+
_decimal.Decimal.to_integral
3973+
3974+
rounding: object = None
3975+
context: object = None
3976+
3977+
Identical to the to_integral_value() method.
3978+
3979+
The to_integral() name has been kept for compatibility with older versions.
3980+
[clinic start generated code]*/
3981+
3982+
static PyObject *
3983+
_decimal_Decimal_to_integral_impl(PyObject *self, PyObject *rounding,
3984+
PyObject *context)
3985+
/*[clinic end generated code: output=a0c7188686ee7f5c input=a57d62d1d29aed1b]*/
3986+
{
3987+
return _decimal_Decimal_to_integral_value_impl(self, rounding, context);
3988+
}
3989+
39693990
/*[clinic input]
39703991
_decimal.Decimal.to_integral_exact
39713992
@@ -4017,27 +4038,6 @@ _decimal_Decimal_to_integral_exact_impl(PyObject *self, PyObject *rounding,
40174038
return result;
40184039
}
40194040

4020-
/*[clinic input]
4021-
_decimal.Decimal.to_integral_value
4022-
4023-
rounding: object = None
4024-
context: object = None
4025-
4026-
Round to the nearest integer without signaling Inexact or Rounded.
4027-
4028-
The rounding mode is determined by the rounding parameter if given, else by
4029-
the given context. If neither parameter is given, then the rounding mode of
4030-
the current default context is used.
4031-
[clinic start generated code]*/
4032-
4033-
static PyObject *
4034-
_decimal_Decimal_to_integral_value_impl(PyObject *self, PyObject *rounding,
4035-
PyObject *context)
4036-
/*[clinic end generated code: output=7301465765f48b6b input=5778168222cadf71]*/
4037-
{
4038-
return _decimal_Decimal_to_integral_impl(self, rounding, context);
4039-
}
4040-
40414041
static PyObject *
40424042
PyDec_AsFloat(PyObject *dec)
40434043
{

Modules/_decimal/clinic/_decimal.c.h

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

0 commit comments

Comments
 (0)