Skip to content

Commit a9b6897

Browse files
committed
Fix inaccurate wording in multiple decimal module docstrings
1 parent 025e7d2 commit a9b6897

3 files changed

Lines changed: 15 additions & 14 deletions

File tree

Lib/_pydecimal.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5076,8 +5076,8 @@ def number_class(self, a):
50765076
"""Returns an indication of the class of the operand.
50775077
50785078
The class is one of the following strings:
5079-
-sNaN
5080-
-NaN
5079+
sNaN
5080+
NaN
50815081
-Infinity
50825082
-Normal
50835083
-Subnormal
@@ -5586,8 +5586,9 @@ def to_integral_value(self, a):
55865586
When the operand has a negative exponent, the result is the same
55875587
as using the quantize() operation using the given operand as the
55885588
left-hand-operand, 1E+0 as the right-hand-operand, and the precision
5589-
of the operand as the precision setting, except that no flags will
5590-
be set. The rounding mode is taken from the context.
5589+
of the operand as the precision setting, except that the Inexact and
5590+
Rounded flags will not be set. The rounding mode is taken from the
5591+
context.
55915592
55925593
>>> ExtendedContext.to_integral_value(Decimal('2.1'))
55935594
Decimal('2')

Modules/_decimal/_decimal.c

Lines changed: 6 additions & 6 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). Etop() must not be negative.
943+
set to 1 (IEEE clamp mode).
944944
[clinic start generated code]*/
945945

946946
static PyObject *
947947
_decimal_Context_Etop_impl(PyObject *self)
948-
/*[clinic end generated code: output=f0a3f6e1b829074e input=35b9defc69d5e5d1]*/
948+
/*[clinic end generated code: output=f0a3f6e1b829074e input=a3e53bbf31ffd330]*/
949949
{
950950
return PyLong_FromSsize_t(mpd_etop(CTX(self)));
951951
}
@@ -6785,7 +6785,7 @@ _decimal.Context.power
67856785
Compute a**b.
67866786
67876787
If 'a' is negative, then 'b' must be integral. The result will be
6788-
inexact unless 'a' is integral and the result is finite and can be
6788+
inexact unless 'b' is integral and the result is finite and can be
67896789
expressed exactly in 'precision' digits. In the Python version the
67906790
result is always correctly rounded, in the C version the result is
67916791
almost always correctly rounded.
@@ -6803,7 +6803,7 @@ restrictions hold:
68036803
static PyObject *
68046804
_decimal_Context_power_impl(PyObject *context, PyTypeObject *cls,
68056805
PyObject *base, PyObject *exp, PyObject *mod)
6806-
/*[clinic end generated code: output=d06d40c37cdd69dc input=178a254468ec189b]*/
6806+
/*[clinic end generated code: output=d06d40c37cdd69dc input=660210a6607ca4b0]*/
68076807
{
68086808
PyObject *a, *b, *c = NULL;
68096809
PyObject *result;
@@ -7063,13 +7063,13 @@ _decimal_Context_apply_impl(PyObject *context, PyTypeObject *cls,
70637063
/*[clinic input]
70647064
_decimal.Context.canonical = _decimal.Context.is_normal
70657065
7066-
Return a new instance of x.
7066+
Return x unchanged.
70677067
[clinic start generated code]*/
70687068

70697069
static PyObject *
70707070
_decimal_Context_canonical_impl(PyObject *context, PyTypeObject *cls,
70717071
PyObject *x)
7072-
/*[clinic end generated code: output=f213e433e2032e5e input=025ecb106ac15bff]*/
7072+
/*[clinic end generated code: output=f213e433e2032e5e input=f8fd49573263a2b6]*/
70737073
{
70747074
decimal_state *state = PyType_GetModuleState(cls);
70757075
if (!PyDec_Check(state, x)) {

Modules/_decimal/clinic/_decimal.c.h

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

0 commit comments

Comments
 (0)