Skip to content

Commit f1ca084

Browse files
committed
address review
1 parent a9b6897 commit f1ca084

2 files changed

Lines changed: 19 additions & 7 deletions

File tree

Modules/_decimal/_decimal.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -940,12 +940,12 @@ _decimal.Context.Etop
940940
Return a value equal to Emax - prec + 1.
941941
942942
This is the maximum exponent if the _clamp field of the context is
943-
set to 1 (IEEE clamp mode).
943+
set to 1 (IEEE clamp mode). Etop() must not be negative.
944944
[clinic start generated code]*/
945945

946946
static PyObject *
947947
_decimal_Context_Etop_impl(PyObject *self)
948-
/*[clinic end generated code: output=f0a3f6e1b829074e input=a3e53bbf31ffd330]*/
948+
/*[clinic end generated code: output=f0a3f6e1b829074e input=35b9defc69d5e5d1]*/
949949
{
950950
return PyLong_FromSsize_t(mpd_etop(CTX(self)));
951951
}
@@ -7063,13 +7063,19 @@ _decimal_Context_apply_impl(PyObject *context, PyTypeObject *cls,
70637063
/*[clinic input]
70647064
_decimal.Context.canonical = _decimal.Context.is_normal
70657065
7066-
Return x unchanged.
7066+
Returns the same Decimal object.
7067+
7068+
As we do not have different encodings for the same number, the
7069+
received object already is in its canonical form.
7070+
7071+
>>> ExtendedContext.canonical(Decimal('2.50'))
7072+
Decimal('2.50')
70677073
[clinic start generated code]*/
70687074

70697075
static PyObject *
70707076
_decimal_Context_canonical_impl(PyObject *context, PyTypeObject *cls,
70717077
PyObject *x)
7072-
/*[clinic end generated code: output=f213e433e2032e5e input=f8fd49573263a2b6]*/
7078+
/*[clinic end generated code: output=f213e433e2032e5e input=12735851b2e36f1c]*/
70737079
{
70747080
decimal_state *state = PyType_GetModuleState(cls);
70757081
if (!PyDec_Check(state, x)) {

Modules/_decimal/clinic/_decimal.c.h

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

0 commit comments

Comments
 (0)