@@ -6789,7 +6789,7 @@ _decimal.Context.power
67896789Compute a**b.
67906790
67916791If 'a' is negative, then 'b' must be integral. The result will be
6792- inexact unless 'a ' is integral and the result is finite and can be
6792+ inexact unless 'b ' is integral and the result is finite and can be
67936793expressed exactly in 'precision' digits. In the Python version the
67946794result is always correctly rounded, in the C version the result is
67956795almost always correctly rounded.
@@ -6807,7 +6807,7 @@ restrictions hold:
68076807static PyObject *
68086808_decimal_Context_power_impl (PyObject * context , PyTypeObject * cls ,
68096809 PyObject * base , PyObject * exp , PyObject * mod )
6810- /*[clinic end generated code: output=d06d40c37cdd69dc input=178a254468ec189b ]*/
6810+ /*[clinic end generated code: output=d06d40c37cdd69dc input=660210a6607ca4b0 ]*/
68116811{
68126812 PyObject * a , * b , * c = NULL ;
68136813 PyObject * result ;
@@ -7067,13 +7067,19 @@ _decimal_Context_apply_impl(PyObject *context, PyTypeObject *cls,
70677067/*[clinic input]
70687068_decimal.Context.canonical = _decimal.Context.is_normal
70697069
7070- Return a new instance of x.
7070+ Returns the same Decimal object.
7071+
7072+ As we do not have different encodings for the same number, the
7073+ received object already is in its canonical form.
7074+
7075+ >>> ExtendedContext.canonical(Decimal('2.50'))
7076+ Decimal('2.50')
70717077[clinic start generated code]*/
70727078
70737079static PyObject *
70747080_decimal_Context_canonical_impl (PyObject * context , PyTypeObject * cls ,
70757081 PyObject * x )
7076- /*[clinic end generated code: output=f213e433e2032e5e input=025ecb106ac15bff ]*/
7082+ /*[clinic end generated code: output=f213e433e2032e5e input=d9f19ee3e7ed9433 ]*/
70777083{
70787084 decimal_state * state = PyType_GetModuleState (cls );
70797085 if (!PyDec_Check (state , x )) {
0 commit comments