summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/ctypes.rst2
-rw-r--r--Doc/library/datetime.rst8
-rw-r--r--Doc/library/random.rst19
-rw-r--r--Doc/library/stdtypes.rst36
-rw-r--r--Doc/reference/datamodel.rst8
-rw-r--r--Doc/reference/simple_stmts.rst3
-rwxr-xr-xDoc/tools/rstlint.py3
7 files changed, 41 insertions, 38 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 - ...
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 57fd63b..502305d 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -317,7 +317,7 @@ Sequences
slicing notations can be used as the target of assignment and :keyword:`del`
(delete) statements.
- There is currently a single intrinsic mutable sequence type:
+ There are currently two intrinsic mutable sequence types:
Lists
.. index:: object: list
@@ -1777,13 +1777,13 @@ left undefined.
object.__ixor__(self, other)
object.__ior__(self, other)
- These methods are called to implement the augmented arithmetic operations
+ These methods are called to implement the augmented arithmetic assignments
(``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, ``>>=``,
``&=``, ``^=``, ``|=``). These methods should attempt to do the operation
in-place (modifying *self*) and return the result (which could be, but does
not have to be, *self*). If a specific method is not defined, the augmented
- operation falls back to the normal methods. For instance, to evaluate the
- expression ``x += y``, where *x* is an instance of a class that has an
+ assignment falls back to the normal methods. For instance, to execute the
+ statement ``x += y``, where *x* is an instance of a class that has an
:meth:`__iadd__` method, ``x.__iadd__(y)`` is called. If *x* is an instance
of a class that does not define a :meth:`__iadd__` method, ``x.__add__(y)``
and ``y.__radd__(x)`` are considered, as with the evaluation of ``x + y``.
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst
index 5793c09..d544990 100644
--- a/Doc/reference/simple_stmts.rst
+++ b/Doc/reference/simple_stmts.rst
@@ -246,7 +246,8 @@ Augmented assignment is the combination, in a single statement, of a binary
operation and an assignment statement:
.. productionlist::
- augmented_assignment_stmt: `target` `augop` (`expression_list` | `yield_expression`)
+ augmented_assignment_stmt: `augtarget` `augop` (`expression_list` | `yield_expression`)
+ augtarget: `identifier` | `attributeref` | `subscription` | `slicing`
augop: "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="
: | ">>=" | "<<=" | "&=" | "^=" | "|="
diff --git a/Doc/tools/rstlint.py b/Doc/tools/rstlint.py
index 7bb0164..eaaf257 100755
--- a/Doc/tools/rstlint.py
+++ b/Doc/tools/rstlint.py
@@ -6,6 +6,9 @@
#
# 01/2009, Georg Brandl
+# TODO: - wrong versions in versionadded/changed
+# - wrong markup after versionchanged directive
+
from __future__ import with_statement
import os