@@ -6749,7 +6749,7 @@ _decimal.Context.power
67496749Compute a**b.
67506750
67516751If 'a' is negative, then 'b' must be integral. The result will be
6752- inexact unless 'a ' is integral and the result is finite and can be
6752+ inexact unless 'b ' is integral and the result is finite and can be
67536753expressed exactly in 'precision' digits. In the Python version the
67546754result is always correctly rounded, in the C version the result is
67556755almost always correctly rounded.
@@ -6767,7 +6767,7 @@ restrictions hold:
67676767static PyObject *
67686768_decimal_Context_power_impl (PyObject * context , PyTypeObject * cls ,
67696769 PyObject * base , PyObject * exp , PyObject * mod )
6770- /*[clinic end generated code: output=d06d40c37cdd69dc input=178a254468ec189b ]*/
6770+ /*[clinic end generated code: output=d06d40c37cdd69dc input=660210a6607ca4b0 ]*/
67716771{
67726772 PyObject * a , * b , * c = NULL ;
67736773 PyObject * result ;
@@ -7027,13 +7027,19 @@ _decimal_Context_apply_impl(PyObject *context, PyTypeObject *cls,
70277027/*[clinic input]
70287028_decimal.Context.canonical = _decimal.Context.is_normal
70297029
7030- Return a new instance of x.
7030+ Returns the same Decimal object.
7031+
7032+ As we do not have different encodings for the same number, the
7033+ received object already is in its canonical form.
7034+
7035+ >>> ExtendedContext.canonical(Decimal('2.50'))
7036+ Decimal('2.50')
70317037[clinic start generated code]*/
70327038
70337039static PyObject *
70347040_decimal_Context_canonical_impl (PyObject * context , PyTypeObject * cls ,
70357041 PyObject * x )
7036- /*[clinic end generated code: output=f213e433e2032e5e input=025ecb106ac15bff ]*/
7042+ /*[clinic end generated code: output=f213e433e2032e5e input=d9f19ee3e7ed9433 ]*/
70377043{
70387044 decimal_state * state = PyType_GetModuleState (cls );
70397045 if (!PyDec_Check (state , x )) {
0 commit comments