@@ -6736,7 +6736,7 @@ _decimal.Context.power
67366736Compute a**b.
67376737
67386738If 'a' is negative, then 'b' must be integral. The result will be
6739- inexact unless 'a ' is integral and the result is finite and can be
6739+ inexact unless 'b ' is integral and the result is finite and can be
67406740expressed exactly in 'precision' digits. In the Python version the
67416741result is always correctly rounded, in the C version the result is
67426742almost always correctly rounded.
@@ -6754,7 +6754,7 @@ restrictions hold:
67546754static PyObject *
67556755_decimal_Context_power_impl (PyObject * context , PyTypeObject * cls ,
67566756 PyObject * base , PyObject * exp , PyObject * mod )
6757- /*[clinic end generated code: output=d06d40c37cdd69dc input=178a254468ec189b ]*/
6757+ /*[clinic end generated code: output=d06d40c37cdd69dc input=660210a6607ca4b0 ]*/
67586758{
67596759 PyObject * a , * b , * c = NULL ;
67606760 PyObject * result ;
@@ -7014,13 +7014,19 @@ _decimal_Context_apply_impl(PyObject *context, PyTypeObject *cls,
70147014/*[clinic input]
70157015_decimal.Context.canonical = _decimal.Context.is_normal
70167016
7017- Return a new instance of x.
7017+ Returns the same Decimal object.
7018+
7019+ As we do not have different encodings for the same number, the
7020+ received object already is in its canonical form.
7021+
7022+ >>> ExtendedContext.canonical(Decimal('2.50'))
7023+ Decimal('2.50')
70187024[clinic start generated code]*/
70197025
70207026static PyObject *
70217027_decimal_Context_canonical_impl (PyObject * context , PyTypeObject * cls ,
70227028 PyObject * x )
7023- /*[clinic end generated code: output=f213e433e2032e5e input=025ecb106ac15bff ]*/
7029+ /*[clinic end generated code: output=f213e433e2032e5e input=d9f19ee3e7ed9433 ]*/
70247030{
70257031 decimal_state * state = PyType_GetModuleState (cls );
70267032 if (!PyDec_Check (state , x )) {
0 commit comments