diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-01-18 22:27:04 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-01-18 22:27:04 (GMT) |
commit | b58dda7bdb6b4f2203c249eb75a639ff7371d5b7 (patch) | |
tree | 18ff28fbf2e27b2a15a29089e0e26899cd1e4cc1 /Doc/library | |
parent | b54797951595f69c38aebbf739e22e540e40f311 (diff) | |
download | cpython-b58dda7bdb6b4f2203c249eb75a639ff7371d5b7.zip cpython-b58dda7bdb6b4f2203c249eb75a639ff7371d5b7.tar.gz cpython-b58dda7bdb6b4f2203c249eb75a639ff7371d5b7.tar.bz2 |
Merged revisions 68633,68648,68667,68706,68718,68720-68721,68724-68727,68739 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r68633 | thomas.heller | 2009-01-16 12:53:44 -0600 (Fri, 16 Jan 2009) | 3 lines
Change an example in the docs to avoid a mistake when the code is copy
pasted and changed afterwards.
........
r68648 | benjamin.peterson | 2009-01-16 22:28:57 -0600 (Fri, 16 Jan 2009) | 1 line
use enumerate
........
r68667 | amaury.forgeotdarc | 2009-01-17 14:18:59 -0600 (Sat, 17 Jan 2009) | 3 lines
#4077: No need to append \n when calling Py_FatalError
+ fix a declaration to make it match the one in pythonrun.h
........
r68706 | benjamin.peterson | 2009-01-17 19:28:46 -0600 (Sat, 17 Jan 2009) | 1 line
fix grammar
........
r68718 | georg.brandl | 2009-01-18 04:42:35 -0600 (Sun, 18 Jan 2009) | 1 line
#4976: union() and intersection() take multiple args, but talk about "the other".
........
r68720 | georg.brandl | 2009-01-18 04:45:22 -0600 (Sun, 18 Jan 2009) | 1 line
#4974: fix redundant mention of lists and tuples.
........
r68721 | georg.brandl | 2009-01-18 04:48:16 -0600 (Sun, 18 Jan 2009) | 1 line
#4914: trunc is in math.
........
r68724 | georg.brandl | 2009-01-18 07:24:10 -0600 (Sun, 18 Jan 2009) | 1 line
#4979: correct result range for some random functions.
........
r68725 | georg.brandl | 2009-01-18 07:47:26 -0600 (Sun, 18 Jan 2009) | 1 line
#4857: fix augmented assignment target spec.
........
r68726 | georg.brandl | 2009-01-18 08:41:52 -0600 (Sun, 18 Jan 2009) | 1 line
#4923: clarify what was added.
........
r68727 | georg.brandl | 2009-01-18 12:25:30 -0600 (Sun, 18 Jan 2009) | 1 line
#4986: augassigns are not expressions.
........
r68739 | benjamin.peterson | 2009-01-18 15:11:38 -0600 (Sun, 18 Jan 2009) | 1 line
fix test that wasn't working as expected #4990
........
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/ctypes.rst | 2 | ||||
-rw-r--r-- | Doc/library/datetime.rst | 8 | ||||
-rw-r--r-- | Doc/library/random.rst | 19 | ||||
-rw-r--r-- | Doc/library/stdtypes.rst | 36 |
4 files changed, 32 insertions, 33 deletions
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index f2ff1b6..47f9819 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -2406,10 +2406,10 @@ other data types containing pointer type fields. ("hreftype", HREFTYPE)] class TYPEDESC(Structure): + _anonymous_ = ("u",) _fields_ = [("u", _U), ("vt", VARTYPE)] - _anonymous_ = ("u",) The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field specifies which one of the union fields is valid. Since the ``u`` field diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index c37ceb9..e25d042 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -1494,10 +1494,6 @@ For :class:`date` objects, the format codes for hours, minutes, seconds, and microseconds should not be used, as :class:`date` objects have no such values. If they're used anyway, ``0`` is substituted for them. -:class:`time` and :class:`datetime` objects support a ``%f`` format code -which expands to the number of microseconds in the object, zero-padded on -the left to six places. - For a naive object, the ``%z`` and ``%Z`` format codes are replaced by empty strings. @@ -1616,7 +1612,9 @@ Notes: (1) When used with the :func:`strptime` function, the ``%f`` directive accepts from one to six digits and zero pads on the right. ``%f`` is - an extension to the set of format characters in the C standard. + an extension to the set of format characters in the C standard (but + implemented separately in datetime objects, and therefore always + available). (2) When used with the :func:`strptime` function, the ``%p`` directive only affects diff --git a/Doc/library/random.rst b/Doc/library/random.rst index 82d2555..5dcf764 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -149,13 +149,13 @@ be found in any statistics text. .. function:: uniform(a, b) - Return a random floating point number *N* such that ``a <= N < b`` for - ``a <= b`` and ``b <= N < a`` for ``b < a``. + Return a random floating point number *N* such that ``a <= N <= b`` for + ``a <= b`` and ``b <= N <= a`` for ``b < a``. .. function:: triangular(low, high, mode) - Return a random floating point number *N* such that ``low <= N < high`` and + Return a random floating point number *N* such that ``low <= N <= high`` and with the specified *mode* between those bounds. The *low* and *high* bounds default to zero and one. The *mode* argument defaults to the midpoint between the bounds, giving a symmetric distribution. @@ -163,8 +163,8 @@ be found in any statistics text. .. function:: betavariate(alpha, beta) - Beta distribution. Conditions on the parameters are ``alpha > 0`` and ``beta > - 0``. Returned values range between 0 and 1. + Beta distribution. Conditions on the parameters are ``alpha > 0`` and + ``beta > 0``. Returned values range between 0 and 1. .. function:: expovariate(lambd) @@ -178,14 +178,15 @@ be found in any statistics text. .. function:: gammavariate(alpha, beta) - Gamma distribution. (*Not* the gamma function!) Conditions on the parameters - are ``alpha > 0`` and ``beta > 0``. + Gamma distribution. (*Not* the gamma function!) Conditions on the + parameters are ``alpha > 0`` and ``beta > 0``. .. function:: gauss(mu, sigma) - Gaussian distribution. *mu* is the mean, and *sigma* is the standard deviation. - This is slightly faster than the :func:`normalvariate` function defined below. + Gaussian distribution. *mu* is the mean, and *sigma* is the standard + deviation. This is slightly faster than the :func:`normalvariate` function + defined below. .. function:: lognormvariate(mu, sigma) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index f67459b..f2bc7af 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -343,19 +343,19 @@ Notes: All :class:`numbers.Real` types (:class:`int` and :class:`float`) also include the following operations: -+--------------------+--------------------------------+--------+ -| Operation | Result | Notes | -+====================+================================+========+ -| ``trunc(x)`` | *x* truncated to Integral | | -+--------------------+--------------------------------+--------+ -| ``round(x[, n])`` | *x* rounded to n digits, | | -| | rounding half to even. If n is | | -| | omitted, it defaults to 0. | | -+--------------------+--------------------------------+--------+ -| ``math.floor(x)`` | the greatest Integral <= *x* | | -+--------------------+--------------------------------+--------+ -| ``math.ceil(x)`` | the least Integral >= *x* | | -+--------------------+--------------------------------+--------+ ++--------------------+------------------------------------+--------+ +| Operation | Result | Notes | ++====================+====================================+========+ +| ``math.trunc(x)`` | *x* truncated to Integral | | ++--------------------+------------------------------------+--------+ +| ``round(x[, n])`` | *x* rounded to n digits, | | +| | rounding half to even. If n is | | +| | omitted, it defaults to 0. | | ++--------------------+------------------------------------+--------+ +| ``math.floor(x)`` | the greatest integral float <= *x* | | ++--------------------+------------------------------------+--------+ +| ``math.ceil(x)`` | the least integral float >= *x* | | ++--------------------+------------------------------------+--------+ For additional numeric operations see the :mod:`math` and :mod:`cmath` modules. @@ -595,10 +595,10 @@ Sequence Types --- :class:`str`, :class:`bytes`, :class:`bytearray`, :class:`lis ================================================================================================================== There are six sequence types: strings, byte sequences (:class:`bytes` objects), -byte arrays (:class:`bytearray` objects), lists, tuples, and range objects. +byte arrays (:class:`bytearray` objects), lists, tuples, and range objects. For +other containers see the built in :class:`dict` and :class:`set` classes, and +the :mod:`collections` module. -For other containers see the built-in :class:`dict`, :class:`list`, -:class:`set`, and :class:`tuple` classes, and the :mod:`collections` module. .. index:: object: sequence @@ -1623,12 +1623,12 @@ The constructors for both classes work the same: .. method:: union(other, ...) set | other | ... - Return a new set with elements from both sets. + Return a new set with elements from the set and all others. .. method:: intersection(other, ...) set & other & ... - Return a new set with elements common to both sets. + Return a new set with elements common to the set and all others. .. method:: difference(other, ...) set - other - ... |