diff -r 26d5f022eb1a Doc/library/decimal.rst --- a/Doc/library/decimal.rst Thu Jun 02 20:40:35 2011 -0700 +++ b/Doc/library/decimal.rst Fri Jun 03 16:07:58 2011 +0200 @@ -424,8 +424,8 @@ .. method:: compare(other[, context]) - Compare the values of two Decimal instances. This operation behaves in - the same way as the usual comparison method :meth:`__cmp__`, except that + Compare the values of *self* and *other*. This operation behaves in the + same way as the usual comparison method :meth:`__cmp__`, except that :meth:`compare` returns a Decimal instance rather than an integer, and if either operand is a NaN then the result is a NaN:: @@ -444,9 +444,9 @@ .. method:: compare_total(other) - Compare two operands using their abstract representation rather than their - numerical value. Similar to the :meth:`compare` method, but the result - gives a total ordering on :class:`Decimal` instances. Two + Compare *self* and *other* using their abstract representation rather than + their numerical value. Similar to the :meth:`compare` method, but the + result gives a total ordering on :class:`Decimal` instances. Two :class:`Decimal` instances with the same numeric value but different representations compare unequal in this ordering: @@ -455,17 +455,17 @@ Quiet and signaling NaNs are also included in the total ordering. The result of this function is ``Decimal('0')`` if both operands have the same - representation, ``Decimal('-1')`` if the first operand is lower in the - total order than the second, and ``Decimal('1')`` if the first operand is - higher in the total order than the second operand. See the specification - for details of the total order. + representation, ``Decimal('-1')`` if *self* is lower in the total order + than *other*, and ``Decimal('1')`` if *self* is higher in the total order + than *other*. See the specification for details of the total order. .. versionadded:: 2.6 .. method:: compare_total_mag(other) - Compare two operands using their abstract representation rather than their - value as in :meth:`compare_total`, but ignoring the sign of each operand. + Compare *self* and *other* using their abstract representation rather than + their value as in :meth:`compare_total`, but ignoring the sign of each + operand. ``x.compare_total_mag(y)`` is equivalent to ``x.copy_abs().compare_total(y.copy_abs())``. @@ -495,8 +495,8 @@ .. method:: copy_sign(other) - Return a copy of the first operand with the sign set to be the same as the - sign of the second operand. For example: + Return a copy of *self* with the sign set to be the same as the sign of + *other*. For example: >>> Decimal('2.3').copy_sign(Decimal('-1.5')) Decimal('-2.3') @@ -731,10 +731,9 @@ .. method:: next_toward(other[, context]) - If the two operands are unequal, return the number closest to the first - operand in the direction of the second operand. If both operands are - numerically equal, return a copy of the first operand with the sign set to - be the same as the sign of the second operand. + If *self* and *other* are unequal, return the number closest to *self* in + the direction of *other*. If both operands are numerically equal, return + a copy of *self* with the sign set to be the same as the sign of *other*. .. versionadded:: 2.6 @@ -767,8 +766,8 @@ .. method:: quantize(exp[, rounding[, context[, watchexp]]]) - Return a value equal to the first operand after rounding and having the - exponent of the second operand. + Return a value equal to *self* after rounding and having the exponent of + *exp*. >>> Decimal('1.41421356').quantize(Decimal('1.000')) Decimal('1.414') @@ -782,11 +781,11 @@ Also unlike other operations, quantize never signals Underflow, even if the result is subnormal and inexact. - If the exponent of the second operand is larger than that of the first - then rounding may be necessary. In this case, the rounding mode is - determined by the ``rounding`` argument if given, else by the given - ``context`` argument; if neither argument is given the rounding mode of - the current thread's context is used. + If the exponent of *exp* is larger than that of *self* then rounding may + be necessary. In this case, the rounding mode is determined by the + ``rounding`` argument if given, else by the given ``context`` argument; + if neither argument is given the rounding mode of the current thread's + context is used. If *watchexp* is set (default), then an error is returned whenever the resulting exponent is greater than :attr:`Emax` or less than @@ -811,39 +810,37 @@ .. method:: rotate(other[, context]) - Return the result of rotating the digits of the first operand by an amount - specified by the second operand. The second operand must be an integer in - the range -precision through precision. The absolute value of the second - operand gives the number of places to rotate. If the second operand is - positive then rotation is to the left; otherwise rotation is to the right. - The coefficient of the first operand is padded on the left with zeros to - length precision if necessary. The sign and exponent of the first operand - are unchanged. + Return the result of rotating the digits of *self* by an amount specified + by *other*. The operand *other* must be an integer in the range + -precision through precision. The absolute value of *other* gives the + number of places to rotate. If *other* is positive then rotation is to the + left; otherwise rotation is to the right. The coefficient of *self* is + padded on the left with zeros to length precision if necessary. The sign + and exponent of *self* are unchanged. .. versionadded:: 2.6 .. method:: same_quantum(other[, context]) - Test whether self and other have the same exponent or whether both are - :const:`NaN`. + Test whether *self* and *other* have the same exponent or whether both + are :const:`NaN`. .. method:: scaleb(other[, context]) - Return the first operand with exponent adjusted by the second. - Equivalently, return the first operand multiplied by ``10**other``. The - second operand must be an integer. + Return a copy of *self* with exponent adjusted by *other*. Equivalently, + return *self* multiplied by ``10**other``. The operand *other* must be + an integer. .. versionadded:: 2.6 .. method:: shift(other[, context]) - Return the result of shifting the digits of the first operand by an amount - specified by the second operand. The second operand must be an integer in - the range -precision through precision. The absolute value of the second - operand gives the number of places to shift. If the second operand is - positive then the shift is to the left; otherwise the shift is to the - right. Digits shifted into the coefficient are zeros. The sign and - exponent of the first operand are unchanged. + Return the result of shifting the digits of *self* by an amount specified + by *other*. The operand *other* must be an integer in the range + -precision through precision. The absolute value of *other* gives the + number of places to shift. If *other* is positive then the shift is to + the left; otherwise the shift is to the right. Digits shifted into the + coefficient are zeros. The sign and exponent of *self* are unchanged. .. versionadded:: 2.6