diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/calendar.rst | 42 | ||||
-rw-r--r-- | Doc/library/decimal.rst | 15 | ||||
-rw-r--r-- | Doc/library/userdict.rst | 2 |
3 files changed, 36 insertions, 23 deletions
diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index e125ccc..33b2ad7 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -37,9 +37,9 @@ it's the base calendar for all computations. .. method:: Calendar.iterweekdays(weekday) - Return an iterator for the week day numbers that will be used for one week. The - first number from the iterator will be the same as the number returned by - :meth:`firstweekday`. + Return an iterator for the week day numbers that will be used for one week. + The first value from the iterator will be the same as the value of the + :attr:`firstweekday` property. .. method:: Calendar.itermonthdates(year, month) @@ -81,22 +81,22 @@ it's the base calendar for all computations. Weeks are lists of seven day numbers. -.. method:: Calendar.yeardatescalendar(year, month[, width]) +.. method:: Calendar.yeardatescalendar(year[, width]) - Return the data for the specified year ready for formatting. The return value is - a list of month rows. Each month row contains up to *width* months (defaulting - to 3). Each month contains between 4 and 6 weeks and each week contains 1--7 - days. Days are :class:`datetime.date` objects. + Return the data for the specified year ready for formatting. The return value + is a list of month rows. Each month row contains up to *width* months + (defaulting to 3). Each month contains between 4 and 6 weeks and each week + contains 1--7 days. Days are :class:`datetime.date` objects. -.. method:: Calendar.yeardays2calendar(year, month[, width]) +.. method:: Calendar.yeardays2calendar(year[, width]) Return the data for the specified year ready for formatting (similar to - :meth:`yeardatescalendar`). Entries in the week lists are tuples of day numbers - and weekday numbers. Day numbers outside this month are zero. + :meth:`yeardatescalendar`). Entries in the week lists are tuples of day + numbers and weekday numbers. Day numbers outside this month are zero. -.. method:: Calendar.yeardayscalendar(year, month[, width]) +.. method:: Calendar.yeardayscalendar(year[, width]) Return the data for the specified year ready for formatting (similar to :meth:`yeardatescalendar`). Entries in the week lists are day numbers. Day @@ -113,9 +113,10 @@ it's the base calendar for all computations. .. method:: TextCalendar.formatmonth(theyear, themonth[, w[, l]]) Return a month's calendar in a multi-line string. If *w* is provided, it - specifies the width of the date columns, which are centered. If *l* is given, it - specifies the number of lines that each week will use. Depends on the first - weekday as set by :func:`setfirstweekday`. + specifies the width of the date columns, which are centered. If *l* is given, + it specifies the number of lines that each week will use. Depends on the + first weekday as specified in the constructor or set by the + :meth:`setfirstweekday` method. .. method:: TextCalendar.prmonth(theyear, themonth[, w[, l]]) @@ -125,11 +126,12 @@ it's the base calendar for all computations. .. method:: TextCalendar.formatyear(theyear, themonth[, w[, l[, c[, m]]]]) - Return a *m*-column calendar for an entire year as a multi-line string. Optional - parameters *w*, *l*, and *c* are for date column width, lines per week, and - number of spaces between month columns, respectively. Depends on the first - weekday as set by :meth:`setfirstweekday`. The earliest year for which a - calendar can be generated is platform-dependent. + Return a *m*-column calendar for an entire year as a multi-line string. + Optional parameters *w*, *l*, and *c* are for date column width, lines per + week, and number of spaces between month columns, respectively. Depends on + the first weekday as specified in the constructor or set by the + :meth:`setfirstweekday` method. The earliest year for which a calendar can + be generated is platform-dependent. .. method:: TextCalendar.pryear(theyear[, w[, l[, c[, m]]]]) diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index 3c3e613..f6b96b2 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -86,7 +86,7 @@ reset them before monitoring a calculation. Specification <http://www2.hursley.ibm.com/decimal/decarith.html>`_. * IEEE standard 854-1987, `Unofficial IEEE 854 Text - <http://www.cs.berkeley.edu/~ejr/projects/754/private/drafts/854-1987/dir.html>`_. + <http://754r.ucbtest.org/standards/854.pdf>`_. .. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1238,6 +1238,19 @@ A variant is :const:`sNaN` which signals rather than remaining quiet after every operation. This is a useful return value when an invalid result needs to interrupt a calculation for special handling. +The behavior of Python's comparison operators can be a little surprising where a +:const:`NaN` is involved. A test for equality where one of the operands is a +quiet or signaling :const:`NaN` always returns :const:`False` (even when doing +``Decimal('NaN')==Decimal('NaN')``), while a test for inequality always returns +:const:`True`. An attempt to compare two Decimals using any of the ``<``, +``<=``, ``>`` or ``>=`` operators will raise the :exc:`InvalidOperation` signal +if either operand is a :const:`NaN`, and return :const:`False` if this signal is +trapped. Note that the General Decimal Arithmetic specification does not +specify the behavior of direct comparisons; these rules for comparisons +involving a :const:`NaN` were taken from the IEEE 854 standard (see Table 3 in +section 5.7). To ensure strict standards-compliance, use the :meth:`compare` +and :meth:`compare-signal` methods instead. + The signed zeros can result from calculations that underflow. They keep the sign that would have resulted if the calculation had been carried out to greater precision. Since their magnitude is zero, both positive and negative zeros are diff --git a/Doc/library/userdict.rst b/Doc/library/userdict.rst index 1475197..9b03f69 100644 --- a/Doc/library/userdict.rst +++ b/Doc/library/userdict.rst @@ -1,5 +1,3 @@ - - :mod:`UserList` --- Class wrapper for list objects ================================================== |