@@ -940,12 +940,12 @@ _decimal.Context.Etop
940940Return a value equal to Emax - prec + 1.
941941
942942This 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
946946static 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
70697075static 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 )) {
0 commit comments