Commits

Anonymous committed 4d226e1

More fixes by Tim Hatch.

Comments (0)

Files changed (33)

Doc-26/library/anydbm.rst

 .. exception:: error
 
    A tuple containing the exceptions that can be raised by each of the supported
-   modules, with a unique exception :exc:`anydbm.error` as the first item --- the
-   latter is used when :exc:`anydbm.error` is raised.
+   modules, with a unique exception also named :exc:`anydbm.error` as the first
+   item --- the latter is used when :exc:`anydbm.error` is raised.
 
 The object returned by :func:`open` supports most of the same functionality as
 dictionaries; keys and their corresponding values can be stored, retrieved, and

Doc-26/library/cmath.rst

 
 .. function:: asinh(x)
 
-   Return the hyperbolic arc sine of *x*. There are two branch cuts, extending left
-   from ±``1j`` to ±-∞``j``, both continuous from above. These branch cuts should
-   be considered a bug to be corrected in a future release. The correct branch cuts
-   should extend along the imaginary axis, one from ``1j`` up to ∞``j`` and
-   continuous from the right, and one from -\ ``1j`` down to -∞``j`` and continuous
-   from the left.
+   Return the hyperbolic arc sine of *x*. There are two branch cuts, extending
+   left from ``±1j`` to ``±∞j``, both continuous from above. These branch cuts
+   should be considered a bug to be corrected in a future release. The correct
+   branch cuts should extend along the imaginary axis, one from ``1j`` up to
+   ``∞j`` and continuous from the right, and one from ``-1j`` down to ``-∞j``
+   and continuous from the left.
 
 
 .. function:: atan(x)
 
    Return the arc tangent of *x*. There are two branch cuts: One extends from
-   ``1j`` along the imaginary axis to ∞``j``, continuous from the left. The other
-   extends from -\ ``1j`` along the imaginary axis to -∞``j``, continuous from the
-   left. (This should probably be changed so the upper cut becomes continuous from
-   the other side.)
+   ``1j`` along the imaginary axis to ``∞j``, continuous from the left. The
+   other extends from ``-1j`` along the imaginary axis to ``-∞j``, continuous
+   from the left. (This should probably be changed so the upper cut becomes
+   continuous from the other side.)
 
 
 .. function:: atanh(x)
 
-   Return the hyperbolic arc tangent of *x*. There are two branch cuts: One extends
-   from 1 along the real axis to ∞, continuous from above. The other extends from
-   -1 along the real axis to -∞, continuous from above. (This should probably be
-   changed so the right cut becomes continuous from the other side.)
+   Return the hyperbolic arc tangent of *x*. There are two branch cuts: One
+   extends from ``1`` along the real axis to ``∞``, continuous from above. The
+   other extends from ``-1`` along the real axis to ``-∞``, continuous from
+   above. (This should probably be changed so the right cut becomes continuous
+   from the other side.)
 
 
 .. function:: cos(x)
 
 .. data:: pi
 
-   The mathematical constant *pi*, as a real.
+   The mathematical constant *pi*, as a float.
 
 
 .. data:: e
 
-   The mathematical constant *e*, as a real.
+   The mathematical constant *e*, as a float.
 
 .. index:: module: math
 

Doc-26/library/dbhash.rst

    Open a ``db`` database and return the database object.  The *path* argument is
    the name of the database file.
 
-   The *flag* argument can be ``'r'`` (the default), ``'w'``, ``'c'`` (which
-   creates the database if it doesn't exist), or ``'n'`` (which always creates a
-   new empty database). For platforms on which the BSD ``db`` library supports
-   locking, an ``'l'`` can be appended to indicate that locking should be used.
+   The *flag* argument can be:
+
+   +---------+-------------------------------------------+
+   | Value   | Meaning                                   |
+   +=========+===========================================+
+   | ``'r'`` | Open existing database for reading only   |
+   |         | (default)                                 |
+   +---------+-------------------------------------------+
+   | ``'w'`` | Open existing database for reading and    |
+   |         | writing                                   |
+   +---------+-------------------------------------------+
+   | ``'c'`` | Open database for reading and writing,    |
+   |         | creating it if it doesn't exist           |
+   +---------+-------------------------------------------+
+   | ``'n'`` | Always create a new, empty database, open |
+   |         | for reading and writing                   |
+   +---------+-------------------------------------------+
+
+   For platforms on which the BSD ``db`` library supports locking, an ``'l'``
+   can be appended to indicate that locking should be used.
 
    The optional *mode* parameter is used to indicate the Unix permission bits that
    should be set if a new database must be created; this will be masked by the

Doc-26/library/dbm.rst

    :synopsis: The standard "database" interface, based on ndbm.
 
 
-The :mod:`dbm` module provides an interface to the Unix (``n``)``dbm`` library.
-Dbm objects behave like mappings (dictionaries), except that keys and values are
+The :mod:`dbm` module provides an interface to the Unix "(n)dbm" library.  Dbm
+objects behave like mappings (dictionaries), except that keys and values are
 always strings. Printing a dbm object doesn't print the keys and values, and the
 :meth:`items` and :meth:`values` methods are not supported.
 
    +---------+-------------------------------------------+
 
    The optional *mode* argument is the Unix mode of the file, used only when the
-   database has to be created.  It defaults to octal ``0666``.
+   database has to be created.  It defaults to octal ``0666`` (and will be
+   modified by the prevailing umask).
 
 
 .. seealso::

Doc-26/library/filecmp.rst

 Example::
 
    >>> import filecmp
-   >>> filecmp.cmp('libundoc.tex', 'libundoc.tex')
+   >>> filecmp.cmp('undoc.rst', 'undoc.rst')
    True
-   >>> filecmp.cmp('libundoc.tex', 'lib.tex')
+   >>> filecmp.cmp('undoc.rst', 'index.rst')
    False
 
 

Doc-26/library/fileinput.rst

 the list of filenames is noticeable at all is when the last file opened is
 empty.
 
-It is possible that the last line of a file does not end in a newline character;
-lines are returned including the trailing newline when it is present.
+Lines are returned with any newlines intact, which means that the last line in
+a file may not have one.
 
 You can control how files are opened by providing an opening hook via the
-*openhook* parameter to :func:`input` or :class:`FileInput()`. The hook must be
-a function that takes two arguments, *filename* and *mode*, and returns an
-accordingly opened file-like object. Two useful hooks are already provided by
-this module.
+*openhook* parameter to :func:`fileinput.input` or :class:`FileInput()`. The
+hook must be a function that takes two arguments, *filename* and *mode*, and
+returns an accordingly opened file-like object. Two useful hooks are already
+provided by this module.
 
 The following function is the primary interface of this module:
 
    .. versionchanged:: 2.5
       Added the *mode* and *openhook* parameters.
 
-The following functions use the global state created by :func:`input`; if there
-is no active state, :exc:`RuntimeError` is raised.
+The following functions use the global state created by :func:`fileinput.input`;
+if there is no active state, :exc:`RuntimeError` is raised.
 
 
 .. function:: filename()
 .. class:: FileInput([files[, inplace[, backup[, mode[, openhook]]]]])
 
    Class :class:`FileInput` is the implementation; its methods :meth:`filename`,
-   :meth:`fileno`, :meth:`lineno`, :meth:`fileline`, :meth:`isfirstline`,
+   :meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:`isfirstline`,
    :meth:`isstdin`, :meth:`nextfile` and :meth:`close` correspond to the functions
    of the same name in the module. In addition it has a :meth:`readline` method
    which returns the next input line, and a :meth:`__getitem__` method which
       Added the *mode* and *openhook* parameters.
 
 **Optional in-place filtering:** if the keyword argument ``inplace=1`` is passed
-to :func:`input` or to the :class:`FileInput` constructor, the file is moved to
-a backup file and standard output is directed to the input file (if a file of
-the same name as the backup file already exists, it will be replaced silently).
-This makes it possible to write a filter that rewrites its input file in place.
-If the keyword argument ``backup='.<some extension>'`` is also given, it
-specifies the extension for the backup file, and the backup file remains around;
-by default, the extension is ``'.bak'`` and it is deleted when the output file
-is closed.  In-place filtering is disabled when standard input is read.
+to :func:`fileinput.input` or to the :class:`FileInput` constructor, the file is
+moved to a backup file and standard output is directed to the input file (if a
+file of the same name as the backup file already exists, it will be replaced
+silently).  This makes it possible to write a filter that rewrites its input
+file in place.  If the *backup* parameter is given (typically as
+``backup='.<some extension>'``), it specifies the extension for the backup file,
+and the backup file remains around; by default, the extension is ``'.bak'`` and
+it is deleted when the output file is closed.  In-place filtering is disabled
+when standard input is read.
 
 **Caveat:** The current implementation does not work for MS-DOS 8+3 filesystems.
 

Doc-26/library/functools.rst

 have three read-only attributes:
 
 
-.. attribute:: callable.func
+.. attribute:: partial.func
 
    A callable object or function.  Calls to the :class:`partial` object will be
    forwarded to :attr:`func` with new arguments and keywords.
 
 
-.. attribute:: tuple.args
+.. attribute:: partial.args
 
    The leftmost positional arguments that will be prepended to the positional
    arguments provided to a :class:`partial` object call.
 
 
-.. attribute:: dict.keywords
+.. attribute:: partial.keywords
 
    The keyword arguments that will be supplied when the :class:`partial` object is
    called.

Doc-26/library/gdbm.rst

    Open a ``gdbm`` database and return a ``gdbm`` object.  The *filename* argument
    is the name of the database file.
 
-   The optional *flag* argument can be ``'r'`` (to open an existing database for
-   reading only --- default), ``'w'`` (to open an existing database for reading and
-   writing), ``'c'`` (which creates the database if it doesn't exist), or ``'n'``
-   (which always creates a new empty database).
+   The optional *flag* argument can be:
 
-   The following additional characters may be appended to the flag to control how
-   the database is opened:
+   +---------+-------------------------------------------+
+   | Value   | Meaning                                   |
+   +=========+===========================================+
+   | ``'r'`` | Open existing database for reading only   |
+   |         | (default)                                 |
+   +---------+-------------------------------------------+
+   | ``'w'`` | Open existing database for reading and    |
+   |         | writing                                   |
+   +---------+-------------------------------------------+
+   | ``'c'`` | Open database for reading and writing,    |
+   |         | creating it if it doesn't exist           |
+   +---------+-------------------------------------------+
+   | ``'n'`` | Always create a new, empty database, open |
+   |         | for reading and writing                   |
+   +---------+-------------------------------------------+
 
-   * ``'f'`` --- Open the database in fast mode.  Writes to the database will not
-     be synchronized.
+   The following additional characters may be appended to the flag to control
+   how the database is opened:
 
-   * ``'s'`` --- Synchronized mode. This will cause changes to the database will be
-     immediately written to the file.
-
-   * ``'u'`` --- Do not lock database.
+   +---------+--------------------------------------------+
+   | Value   | Meaning                                    |
+   +=========+============================================+
+   | ``'f'`` | Open the database in fast mode.  Writes    |
+   |         | to the database will not be synchronized.  |
+   +---------+--------------------------------------------+
+   | ``'s'`` | Synchronized mode. This will cause changes |
+   |         | to the database to be immediately written  |
+   |         | to the file.                               |
+   +---------+--------------------------------------------+
+   | ``'u'`` | Do not lock database.                      |
+   +---------+--------------------------------------------+
 
    Not all flags are valid for all versions of ``gdbm``.  The module constant
-   ``open_flags`` is a string of supported flag characters.  The exception
+   :const:`open_flags` is a string of supported flag characters.  The exception
    :exc:`error` is raised if an invalid flag is specified.
 
    The optional *mode* argument is the Unix mode of the file, used only when the

Doc-26/library/itertools.rst

 
    If one of the iterables is potentially infinite, then the :func:`izip_longest`
    function should be wrapped with something that limits the number of calls (for
-   example :func:`islice` or :func:`take`).
+   example :func:`islice` or :func:`takewhile`).
 
    .. versionadded:: 2.6
 
    64
 
    >>> reportlines = ['EuroPython', 'Roster', '', 'alex', '', 'laura',
-                     '', 'martin', '', 'walter', '', 'mark']
+   ...                '', 'martin', '', 'walter', '', 'mark']
    >>> for name in islice(reportlines, 3, None, 2):
    ...    print name.title()
    ...

Doc-26/library/marshal.rst

 .. warning::
 
    The :mod:`marshal` module is not intended to be secure against erroneous or
-   maliciously constructed data.  Never unmarshal data received from an untrusted
-   or unauthenticated source.
+   maliciously constructed data.  Never unmarshal data received from an
+   untrusted or unauthenticated source.
 
 Not all Python object types are supported; in general, only objects whose value
 is independent from a particular invocation of Python can be written and read by
 
 .. function:: dump(value, file[, version])
 
-   Write the value on the open file.  The value must be a supported type.  The file
-   must be an open file object such as ``sys.stdout`` or returned by :func:`open`
-   or :func:`posix.popen`.  It must be opened in binary mode (``'wb'`` or
-   ``'w+b'``).
+   Write the value on the open file.  The value must be a supported type.  The
+   file must be an open file object such as ``sys.stdout`` or returned by
+   :func:`open` or :func:`os.popen`.  It must be opened in binary mode (``'wb'``
+   or ``'w+b'``).
 
    If the value has (or contains an object that has) an unsupported type, a
    :exc:`ValueError` exception is raised --- but garbage data will also be written
    to the file.  The object will not be properly read back by :func:`load`.
 
    .. versionadded:: 2.4
-      The *version* argument indicates the data format that ``dump`` should use (see
-      below).
+      The *version* argument indicates the data format that ``dump`` should use
+      (see below).
 
 
 .. function:: load(file)
 
-   Read one value from the open file and return it.  If no valid value is read,
-   raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`.  The file must be
-   an open file object opened in binary mode (``'rb'`` or ``'r+b'``).
+   Read one value from the open file and return it.  If no valid value is read
+   (e.g. because the data has a different Python version's incompatible marshal
+   format), raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`.  The
+   file must be an open file object opened in binary mode (``'rb'`` or
+   ``'r+b'``).
 
    .. warning::
 
    has (or contains an object that has) an unsupported type.
 
    .. versionadded:: 2.4
-      The *version* argument indicates the data format that ``dumps`` should use (see
-      below).
+      The *version* argument indicates the data format that ``dumps`` should use
+      (see below).
 
 
 .. function:: loads(string)
    :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`.  Extra characters in the
    string are ignored.
 
+
 In addition, the following constants are defined:
 
-
 .. data:: version
 
    Indicates the format that the module uses. Version 0 is the historical format,
 
    .. versionadded:: 2.4
 
+
 .. rubric:: Footnotes
 
 .. [#] The name of this module stems from a bit of terminology used by the designers of

Doc-26/library/operator.rst

               __invert__(o)
 
    Return the bitwise inverse of the number *o*.  This is equivalent to ``~o``.
-   The names :func:`invert` and :func:`__invert__` were added in Python 2.0.
+
+   .. versionadded:: 2.0
+      The names :func:`invert` and :func:`__invert__`.
 
 
 .. function:: lshift(a, b)
 
    .. versionadded:: 2.5
 
+
 Operations which work with sequences include:
 
-
 .. function:: concat(a, b)
               __concat__(a, b)
 
 .. function:: contains(a, b)
               __contains__(a, b)
 
-   Return the outcome of the test ``b in a``. Note the reversed operands.  The
-   name :func:`__contains__` was added in Python 2.0.
+   Return the outcome of the test ``b in a``. Note the reversed operands.
+
+   .. versionadded:: 2.0
+      The name :func:`__contains__`.
 
 
 .. function:: countOf(a, b)
    >>> vals = map(chr, keys)
    >>> map(operator.setitem, [d]*len(keys), keys, vals)
 
+.. XXX: find a better, readable, example
+
 The :mod:`operator` module also defines tools for generalized attribute and item
 lookups.  These are useful for making fast field extractors as arguments for
 :func:`map`, :func:`sorted`, :meth:`itertools.groupby`, or other functions that
 +-----------------------+-------------------------+---------------------------------+
 | Containment Test      | ``o in seq``            | ``contains(seq, o)``            |
 +-----------------------+-------------------------+---------------------------------+
-| Division              | ``a / b``               | ``div(a, b) #`` without         |
-|                       |                         | ``__future__.division``         |
+| Division              | ``a / b``               | ``div(a, b)`` (without          |
+|                       |                         | ``__future__.division``)        |
 +-----------------------+-------------------------+---------------------------------+
-| Division              | ``a / b``               | ``truediv(a, b) #`` with        |
-|                       |                         | ``__future__.division``         |
+| Division              | ``a / b``               | ``truediv(a, b)`` (with         |
+|                       |                         | ``__future__.division``)        |
 +-----------------------+-------------------------+---------------------------------+
 | Division              | ``a // b``              | ``floordiv(a, b)``              |
 +-----------------------+-------------------------+---------------------------------+
 +-----------------------+-------------------------+---------------------------------+
 | Sequence Repitition   | ``seq * i``             | ``repeat(seq, i)``              |
 +-----------------------+-------------------------+---------------------------------+
-| Slice Assignment      | ``seq[i:j]`` = *values* | ``setslice(seq, i, j, values)`` |
+| Slice Assignment      | ``seq[i:j] = values``   | ``setslice(seq, i, j, values)`` |
 +-----------------------+-------------------------+---------------------------------+
 | Slice Deletion        | ``del seq[i:j]``        | ``delslice(seq, i, j)``         |
 +-----------------------+-------------------------+---------------------------------+

Doc-26/library/os.path.rst

    the concatenation of *path1*, and optionally *path2*, etc., with exactly one
    directory separator (``os.sep``) inserted between components, unless *path2* is
    empty.  Note that on Windows, since there is a current directory for each drive,
-   :func:`os.path.join("c:", "foo")` represents a path relative to the current
+   ``os.path.join("c:", "foo")`` represents a path relative to the current
    directory on drive :file:`C:` (:file:`c:foo`), not :file:`c:\\foo`.
 
 
 
    Split the pathname *path* into a pair ``(root, ext)``  such that ``root + ext ==
    path``, and *ext* is empty or begins with a period and contains at most one
-   period. Leading periods on the basename are  ignored; ``splitext.('.cshrc')``
+   period. Leading periods on the basename are  ignored; ``splitext('.cshrc')``
    returns  ``('.cshrc', '')``.
 
    .. versionchanged:: 2.6
-      Earlier versions could produce an empty root when the only period was the first
-      character.
+      Earlier versions could produce an empty root when the only period was the
+      first character.
 
 
 .. function:: splitunc(path)

Doc-26/library/pickle.rst

 * Protocol version 2 was introduced in Python 2.3.  It provides much more
   efficient pickling of new-style classes.
 
-Refer to PEP 307 for more information.
+Refer to :pep:`307` for more information.
 
 If a *protocol* is not specified, protocol 0 is used. If *protocol* is specified
 as a negative value or :const:`HIGHEST_PROTOCOL`, the highest protocol version
    This takes a file-like object to which it will write a pickle data stream.
 
    If the *protocol* parameter is omitted, protocol 0 is used. If *protocol* is
-   specified as a negative value, the highest protocol version will be used.
+   specified as a negative value or :const:`HIGHEST_PROTOCOL`, the highest
+   protocol version will be used.
 
    .. versionchanged:: 2.3
       Introduced the *protocol* parameter.
    Read a pickled object representation from the open file object given in the
    constructor, and return the reconstituted object hierarchy specified therein.
 
+   This method automatically determines whether the data stream was written in
+   binary mode or not.
+
 
 .. method:: Unpickler.noload()
 
 reading resumes from the last location. The :meth:`__setstate__` and
 :meth:`__getstate__` methods are used to implement this behavior. ::
 
+   #!/usr/local/bin/python
+
    class TextReader:
        """Print and number lines in a text file."""
        def __init__(self, file):
    >>> obj = TextReader.TextReader("TextReader.py")
    >>> obj.readline()
    '1: #!/usr/local/bin/python'
-   >>> # (more invocations of obj.readline() here)
-   ... obj.readline()
-   '7: class TextReader:'
+   >>> obj.readline()
+   '2: '
+   >>> obj.readline()
+   '3: class TextReader:'
    >>> import pickle
-   >>> pickle.dump(obj,open('save.p', 'wb'))
+   >>> pickle.dump(obj, open('save.p', 'wb'))
 
 If you want to see that :mod:`pickle` works across Python processes, start
 another Python session, before continuing.  What follows can happen from either
    >>> import pickle
    >>> reader = pickle.load(open('save.p', 'rb'))
    >>> reader.readline()
-   '8:     "Print and number lines in a text file."'
+   '4:     """Print and number lines in a text file."""'
 
 
 .. seealso::

Doc-26/library/random.rst

    .. versionadded:: 2.1
 
    .. versionchanged:: 2.3
-      Instead of jumping to a specific state, *n* steps ahead, :meth:`jumpahead(n)`
+      Instead of jumping to a specific state, *n* steps ahead, ``jumpahead(n)``
       jumps to another state likely to be separated by many steps.
 
 
 
 .. function:: uniform(a, b)
 
-   Return a random real number *N* such that ``a <= N < b``.
+   Return a random floating point number *N* such that ``a <= N < b``.
 
 
 .. function:: betavariate(alpha, beta)
 
 .. function:: vonmisesvariate(mu, kappa)
 
-   *mu* is the mean angle, expressed in radians between 0 and 2\**pi*, and *kappa*
+   *mu* is the mean angle, expressed in radians between 0 and 2\*\ *pi*, and *kappa*
    is the concentration parameter, which must be greater than or equal to zero.  If
    *kappa* is equal to zero, this distribution reduces to a uniform random angle
-   over the range 0 to 2\**pi*.
+   over the range 0 to 2\*\ *pi*.
 
 
 .. function:: paretovariate(alpha)
    Weibull distribution.  *alpha* is the scale parameter and *beta* is the shape
    parameter.
 
+
 Alternative Generators:
 
-
 .. class:: WichmannHill([seed])
 
    Class that implements the Wichmann-Hill algorithm as the core generator. Has all

Doc-26/library/shutil.rst

 .. function:: copy2(src, dst)
 
    Similar to :func:`copy`, but last access time and last modification time are
-   copied as well.  This is similar to the Unix command :program:`cp` :option:`-p`.
+   copied as well.  This is similar to the Unix command :program:`cp -p`.
 
 
 .. function:: copytree(src, dst[, symlinks])
 above, with the docstring omitted.  It demonstrates many of the other functions
 provided by this module. ::
 
-   def copytree(src, dst, symlinks=0):
+   def copytree(src, dst, symlinks=False):
        names = os.listdir(src)
-       os.mkdir(dst)
+       os.makedirs(dst)
+       errors = []
        for name in names:
            srcname = os.path.join(src, name)
            dstname = os.path.join(dst, name)
                    copytree(srcname, dstname, symlinks)
                else:
                    copy2(srcname, dstname)
+               # XXX What about devices, sockets etc.?
            except (IOError, os.error), why:
-               print "Can't copy %s to %s: %s" % (`srcname`, `dstname`, str(why))
-
+               errors.append((srcname, dstname, str(why)))
+           # catch the Error from the recursive copytree so that we can
+           # continue with other files
+           except Error, err:
+               errors.extend(err.args[0])
+       try:
+           copystat(src, dst)
+       except WindowsError:
+           # can't copy file access times on Windows
+           pass
+       except OSError, why:
+           errors.extend((src, dst, str(why)))
+       if errors:
+           raise Error, errors

Doc-26/library/tempfile.rst

 
 .. function:: mkstemp([suffix[, prefix[, dir[, text]]]])
 
-   Creates a temporary file in the most secure manner possible.  There are no race
-   conditions in the file's creation, assuming that the platform properly
-   implements the :const:`O_EXCL` flag for :func:`os.open`.  The file is readable
-   and writable only by the creating user ID.  If the platform uses permission bits
-   to indicate whether a file is executable, the file is executable by no one.  The
-   file descriptor is not inherited by child processes.
+   Creates a temporary file in the most secure manner possible.  There are no
+   race conditions in the file's creation, assuming that the platform properly
+   implements the :const:`os.O_EXCL` flag for :func:`os.open`.  The file is
+   readable and writable only by the creating user ID.  If the platform uses
+   permission bits to indicate whether a file is executable, the file is
+   executable by no one.  The file descriptor is not inherited by child
+   processes.
 
    Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible for
    deleting the temporary file when done with it.
       * On RiscOS, the directory named by the :envvar:`Wimp$ScrapDir` environment
         variable.
 
-      * On Windows, the directories :file:`C:$\\TEMP`, :file:`C:$\\TMP`,
+      * On Windows, the directories :file:`C:\\TEMP`, :file:`C:\\TMP`,
         :file:`\\TEMP`, and :file:`\\TMP`, in that order.
 
       * On all other platforms, the directories :file:`/tmp`, :file:`/var/tmp`, and
 .. function:: gettempdir()
 
    Return the directory currently selected to create temporary files in. If
-   ``tempdir`` is not ``None``, this simply returns its contents; otherwise, the
-   search described above is performed, and the result returned.
+   :data:`tempdir` is not ``None``, this simply returns its contents; otherwise,
+   the search described above is performed, and the result returned.
 
 
 .. data:: template

Doc-3k/library/anydbm.rst

 .. exception:: error
 
    A tuple containing the exceptions that can be raised by each of the supported
-   modules, with a unique exception :exc:`anydbm.error` as the first item --- the
-   latter is used when :exc:`anydbm.error` is raised.
+   modules, with a unique exception also named :exc:`anydbm.error` as the first
+   item --- the latter is used when :exc:`anydbm.error` is raised.
 
 The object returned by :func:`open` supports most of the same functionality as
 dictionaries; keys and their corresponding values can be stored, retrieved, and

Doc-3k/library/cmath.rst

 
 .. function:: asinh(x)
 
-   Return the hyperbolic arc sine of *x*. There are two branch cuts, extending left
-   from ±``1j`` to ±-∞``j``, both continuous from above. These branch cuts should
-   be considered a bug to be corrected in a future release. The correct branch cuts
-   should extend along the imaginary axis, one from ``1j`` up to ∞``j`` and
-   continuous from the right, and one from -\ ``1j`` down to -∞``j`` and continuous
-   from the left.
+   Return the hyperbolic arc sine of *x*. There are two branch cuts, extending
+   left from ``±1j`` to ``±∞j``, both continuous from above. These branch cuts
+   should be considered a bug to be corrected in a future release. The correct
+   branch cuts should extend along the imaginary axis, one from ``1j`` up to
+   ``∞j`` and continuous from the right, and one from ``-1j`` down to ``-∞j``
+   and continuous from the left.
 
 
 .. function:: atan(x)
 
    Return the arc tangent of *x*. There are two branch cuts: One extends from
-   ``1j`` along the imaginary axis to ∞``j``, continuous from the left. The other
-   extends from -\ ``1j`` along the imaginary axis to -∞``j``, continuous from the
-   left. (This should probably be changed so the upper cut becomes continuous from
-   the other side.)
+   ``1j`` along the imaginary axis to ``∞j``, continuous from the left. The
+   other extends from ``-1j`` along the imaginary axis to ``-∞j``, continuous
+   from the left. (This should probably be changed so the upper cut becomes
+   continuous from the other side.)
 
 
 .. function:: atanh(x)
 
-   Return the hyperbolic arc tangent of *x*. There are two branch cuts: One extends
-   from 1 along the real axis to ∞, continuous from above. The other extends from
-   -1 along the real axis to -∞, continuous from above. (This should probably be
-   changed so the right cut becomes continuous from the other side.)
+   Return the hyperbolic arc tangent of *x*. There are two branch cuts: One
+   extends from ``1`` along the real axis to ``∞``, continuous from above. The
+   other extends from ``-1`` along the real axis to ``-∞``, continuous from
+   above. (This should probably be changed so the right cut becomes continuous
+   from the other side.)
 
 
 .. function:: cos(x)
 
 .. data:: pi
 
-   The mathematical constant *pi*, as a real.
+   The mathematical constant *pi*, as a float.
 
 
 .. data:: e
 
-   The mathematical constant *e*, as a real.
+   The mathematical constant *e*, as a float.
 
 .. index:: module: math
 

Doc-3k/library/dbhash.rst

    Open a ``db`` database and return the database object.  The *path* argument is
    the name of the database file.
 
-   The *flag* argument can be ``'r'`` (the default), ``'w'``, ``'c'`` (which
-   creates the database if it doesn't exist), or ``'n'`` (which always creates a
-   new empty database). For platforms on which the BSD ``db`` library supports
-   locking, an ``'l'`` can be appended to indicate that locking should be used.
+   The *flag* argument can be:
+
+   +---------+-------------------------------------------+
+   | Value   | Meaning                                   |
+   +=========+===========================================+
+   | ``'r'`` | Open existing database for reading only   |
+   |         | (default)                                 |
+   +---------+-------------------------------------------+
+   | ``'w'`` | Open existing database for reading and    |
+   |         | writing                                   |
+   +---------+-------------------------------------------+
+   | ``'c'`` | Open database for reading and writing,    |
+   |         | creating it if it doesn't exist           |
+   +---------+-------------------------------------------+
+   | ``'n'`` | Always create a new, empty database, open |
+   |         | for reading and writing                   |
+   +---------+-------------------------------------------+
+
+   For platforms on which the BSD ``db`` library supports locking, an ``'l'``
+   can be appended to indicate that locking should be used.
 
    The optional *mode* parameter is used to indicate the Unix permission bits that
    should be set if a new database must be created; this will be masked by the

Doc-3k/library/dbm.rst

    :synopsis: The standard "database" interface, based on ndbm.
 
 
-The :mod:`dbm` module provides an interface to the Unix (``n``)``dbm`` library.
-Dbm objects behave like mappings (dictionaries), except that keys and values are
+The :mod:`dbm` module provides an interface to the Unix "(n)dbm" library.  Dbm
+objects behave like mappings (dictionaries), except that keys and values are
 always strings. Printing a dbm object doesn't print the keys and values, and the
 :meth:`items` and :meth:`values` methods are not supported.
 
    +---------+-------------------------------------------+
 
    The optional *mode* argument is the Unix mode of the file, used only when the
-   database has to be created.  It defaults to octal ``0666``.
+   database has to be created.  It defaults to octal ``0666`` (and will be
+   modified by the prevailing umask).
 
 
 .. seealso::

Doc-3k/library/filecmp.rst

 Example::
 
    >>> import filecmp
-   >>> filecmp.cmp('libundoc.tex', 'libundoc.tex')
+   >>> filecmp.cmp('undoc.rst', 'undoc.rst')
    True
-   >>> filecmp.cmp('libundoc.tex', 'lib.tex')
+   >>> filecmp.cmp('undoc.rst', 'index.rst')
    False
 
 

Doc-3k/library/fileinput.rst

 the list of filenames is noticeable at all is when the last file opened is
 empty.
 
-It is possible that the last line of a file does not end in a newline character;
-lines are returned including the trailing newline when it is present.
+Lines are returned with any newlines intact, which means that the last line in
+a file may not have one.
 
 You can control how files are opened by providing an opening hook via the
-*openhook* parameter to :func:`input` or :class:`FileInput()`. The hook must be
-a function that takes two arguments, *filename* and *mode*, and returns an
-accordingly opened file-like object. Two useful hooks are already provided by
-this module.
+*openhook* parameter to :func:`fileinput.input` or :class:`FileInput()`. The
+hook must be a function that takes two arguments, *filename* and *mode*, and
+returns an accordingly opened file-like object. Two useful hooks are already
+provided by this module.
 
 The following function is the primary interface of this module:
 
    .. versionchanged:: 2.5
       Added the *mode* and *openhook* parameters.
 
-The following functions use the global state created by :func:`input`; if there
-is no active state, :exc:`RuntimeError` is raised.
+The following functions use the global state created by :func:`fileinput.input`;
+if there is no active state, :exc:`RuntimeError` is raised.
 
 
 .. function:: filename()
 .. class:: FileInput([files[, inplace[, backup[, mode[, openhook]]]]])
 
    Class :class:`FileInput` is the implementation; its methods :meth:`filename`,
-   :meth:`fileno`, :meth:`lineno`, :meth:`fileline`, :meth:`isfirstline`,
+   :meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:`isfirstline`,
    :meth:`isstdin`, :meth:`nextfile` and :meth:`close` correspond to the functions
    of the same name in the module. In addition it has a :meth:`readline` method
    which returns the next input line, and a :meth:`__getitem__` method which
       Added the *mode* and *openhook* parameters.
 
 **Optional in-place filtering:** if the keyword argument ``inplace=1`` is passed
-to :func:`input` or to the :class:`FileInput` constructor, the file is moved to
-a backup file and standard output is directed to the input file (if a file of
-the same name as the backup file already exists, it will be replaced silently).
-This makes it possible to write a filter that rewrites its input file in place.
-If the keyword argument ``backup='.<some extension>'`` is also given, it
-specifies the extension for the backup file, and the backup file remains around;
-by default, the extension is ``'.bak'`` and it is deleted when the output file
-is closed.  In-place filtering is disabled when standard input is read.
+to :func:`fileinput.input` or to the :class:`FileInput` constructor, the file is
+moved to a backup file and standard output is directed to the input file (if a
+file of the same name as the backup file already exists, it will be replaced
+silently).  This makes it possible to write a filter that rewrites its input
+file in place.  If the *backup* parameter is given (typically as
+``backup='.<some extension>'``), it specifies the extension for the backup file,
+and the backup file remains around; by default, the extension is ``'.bak'`` and
+it is deleted when the output file is closed.  In-place filtering is disabled
+when standard input is read.
 
 **Caveat:** The current implementation does not work for MS-DOS 8+3 filesystems.
 

Doc-3k/library/functools.rst

 have three read-only attributes:
 
 
-.. attribute:: callable.func
+.. attribute:: partial.func
 
    A callable object or function.  Calls to the :class:`partial` object will be
    forwarded to :attr:`func` with new arguments and keywords.
 
 
-.. attribute:: tuple.args
+.. attribute:: partial.args
 
    The leftmost positional arguments that will be prepended to the positional
    arguments provided to a :class:`partial` object call.
 
 
-.. attribute:: dict.keywords
+.. attribute:: partial.keywords
 
    The keyword arguments that will be supplied when the :class:`partial` object is
    called.

Doc-3k/library/gdbm.rst

    Open a ``gdbm`` database and return a ``gdbm`` object.  The *filename* argument
    is the name of the database file.
 
-   The optional *flag* argument can be ``'r'`` (to open an existing database for
-   reading only --- default), ``'w'`` (to open an existing database for reading and
-   writing), ``'c'`` (which creates the database if it doesn't exist), or ``'n'``
-   (which always creates a new empty database).
+   The optional *flag* argument can be:
 
-   The following additional characters may be appended to the flag to control how
-   the database is opened:
+   +---------+-------------------------------------------+
+   | Value   | Meaning                                   |
+   +=========+===========================================+
+   | ``'r'`` | Open existing database for reading only   |
+   |         | (default)                                 |
+   +---------+-------------------------------------------+
+   | ``'w'`` | Open existing database for reading and    |
+   |         | writing                                   |
+   +---------+-------------------------------------------+
+   | ``'c'`` | Open database for reading and writing,    |
+   |         | creating it if it doesn't exist           |
+   +---------+-------------------------------------------+
+   | ``'n'`` | Always create a new, empty database, open |
+   |         | for reading and writing                   |
+   +---------+-------------------------------------------+
 
-   * ``'f'`` --- Open the database in fast mode.  Writes to the database will not
-     be synchronized.
+   The following additional characters may be appended to the flag to control
+   how the database is opened:
 
-   * ``'s'`` --- Synchronized mode. This will cause changes to the database will be
-     immediately written to the file.
-
-   * ``'u'`` --- Do not lock database.
+   +---------+--------------------------------------------+
+   | Value   | Meaning                                    |
+   +=========+============================================+
+   | ``'f'`` | Open the database in fast mode.  Writes    |
+   |         | to the database will not be synchronized.  |
+   +---------+--------------------------------------------+
+   | ``'s'`` | Synchronized mode. This will cause changes |
+   |         | to the database to be immediately written  |
+   |         | to the file.                               |
+   +---------+--------------------------------------------+
+   | ``'u'`` | Do not lock database.                      |
+   +---------+--------------------------------------------+
 
    Not all flags are valid for all versions of ``gdbm``.  The module constant
-   ``open_flags`` is a string of supported flag characters.  The exception
+   :const:`open_flags` is a string of supported flag characters.  The exception
    :exc:`error` is raised if an invalid flag is specified.
 
    The optional *mode* argument is the Unix mode of the file, used only when the

Doc-3k/library/itertools.rst

 
    If one of the iterables is potentially infinite, then the :func:`izip_longest`
    function should be wrapped with something that limits the number of calls (for
-   example :func:`islice` or :func:`take`).
+   example :func:`islice` or :func:`takewhile`).
 
    .. versionadded:: 2.6
 
    64
 
    >>> reportlines = ['EuroPython', 'Roster', '', 'alex', '', 'laura',
-                     '', 'martin', '', 'walter', '', 'mark']
+   ...                '', 'martin', '', 'walter', '', 'mark']
    >>> for name in islice(reportlines, 3, None, 2):
    ...    print name.title()
    ...

Doc-3k/library/marshal.rst

 .. warning::
 
    The :mod:`marshal` module is not intended to be secure against erroneous or
-   maliciously constructed data.  Never unmarshal data received from an untrusted
-   or unauthenticated source.
+   maliciously constructed data.  Never unmarshal data received from an
+   untrusted or unauthenticated source.
 
 Not all Python object types are supported; in general, only objects whose value
 is independent from a particular invocation of Python can be written and read by
 
 .. function:: dump(value, file[, version])
 
-   Write the value on the open file.  The value must be a supported type.  The file
-   must be an open file object such as ``sys.stdout`` or returned by :func:`open`
-   or :func:`posix.popen`.  It must be opened in binary mode (``'wb'`` or
-   ``'w+b'``).
+   Write the value on the open file.  The value must be a supported type.  The
+   file must be an open file object such as ``sys.stdout`` or returned by
+   :func:`open` or :func:`os.popen`.  It must be opened in binary mode (``'wb'``
+   or ``'w+b'``).
 
    If the value has (or contains an object that has) an unsupported type, a
    :exc:`ValueError` exception is raised --- but garbage data will also be written
    to the file.  The object will not be properly read back by :func:`load`.
 
    .. versionadded:: 2.4
-      The *version* argument indicates the data format that ``dump`` should use (see
-      below).
+      The *version* argument indicates the data format that ``dump`` should use
+      (see below).
 
 
 .. function:: load(file)
 
-   Read one value from the open file and return it.  If no valid value is read,
-   raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`.  The file must be
-   an open file object opened in binary mode (``'rb'`` or ``'r+b'``).
+   Read one value from the open file and return it.  If no valid value is read
+   (e.g. because the data has a different Python version's incompatible marshal
+   format), raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`.  The
+   file must be an open file object opened in binary mode (``'rb'`` or
+   ``'r+b'``).
 
    .. warning::
 
    has (or contains an object that has) an unsupported type.
 
    .. versionadded:: 2.4
-      The *version* argument indicates the data format that ``dumps`` should use (see
-      below).
+      The *version* argument indicates the data format that ``dumps`` should use
+      (see below).
 
 
 .. function:: loads(string)
    :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`.  Extra characters in the
    string are ignored.
 
+
 In addition, the following constants are defined:
 
-
 .. data:: version
 
    Indicates the format that the module uses. Version 0 is the historical format,
 
    .. versionadded:: 2.4
 
+
 .. rubric:: Footnotes
 
 .. [#] The name of this module stems from a bit of terminology used by the designers of

Doc-3k/library/operator.rst

               __invert__(o)
 
    Return the bitwise inverse of the number *o*.  This is equivalent to ``~o``.
-   The names :func:`invert` and :func:`__invert__` were added in Python 2.0.
+
+   .. versionadded:: 2.0
+      The names :func:`invert` and :func:`__invert__`.
 
 
 .. function:: lshift(a, b)
 
    .. versionadded:: 2.5
 
+
 Operations which work with sequences include:
 
-
 .. function:: concat(a, b)
               __concat__(a, b)
 
 .. function:: contains(a, b)
               __contains__(a, b)
 
-   Return the outcome of the test ``b in a``. Note the reversed operands.  The
-   name :func:`__contains__` was added in Python 2.0.
+   Return the outcome of the test ``b in a``. Note the reversed operands.
+
+   .. versionadded:: 2.0
+      The name :func:`__contains__`.
 
 
 .. function:: countOf(a, b)
    >>> vals = map(chr, keys)
    >>> map(operator.setitem, [d]*len(keys), keys, vals)
 
+.. XXX: find a better, readable, example
+
 The :mod:`operator` module also defines tools for generalized attribute and item
 lookups.  These are useful for making fast field extractors as arguments for
 :func:`map`, :func:`sorted`, :meth:`itertools.groupby`, or other functions that
 +-----------------------+-------------------------+---------------------------------+
 | Containment Test      | ``o in seq``            | ``contains(seq, o)``            |
 +-----------------------+-------------------------+---------------------------------+
-| Division              | ``a / b``               | ``div(a, b) #`` without         |
-|                       |                         | ``__future__.division``         |
+| Division              | ``a / b``               | ``div(a, b)`` (without          |
+|                       |                         | ``__future__.division``)        |
 +-----------------------+-------------------------+---------------------------------+
-| Division              | ``a / b``               | ``truediv(a, b) #`` with        |
-|                       |                         | ``__future__.division``         |
+| Division              | ``a / b``               | ``truediv(a, b)`` (with         |
+|                       |                         | ``__future__.division``)        |
 +-----------------------+-------------------------+---------------------------------+
 | Division              | ``a // b``              | ``floordiv(a, b)``              |
 +-----------------------+-------------------------+---------------------------------+
 +-----------------------+-------------------------+---------------------------------+
 | Sequence Repitition   | ``seq * i``             | ``repeat(seq, i)``              |
 +-----------------------+-------------------------+---------------------------------+
-| Slice Assignment      | ``seq[i:j]`` = *values* | ``setslice(seq, i, j, values)`` |
+| Slice Assignment      | ``seq[i:j] = values``   | ``setslice(seq, i, j, values)`` |
 +-----------------------+-------------------------+---------------------------------+
 | Slice Deletion        | ``del seq[i:j]``        | ``delslice(seq, i, j)``         |
 +-----------------------+-------------------------+---------------------------------+

Doc-3k/library/os.path.rst

    the concatenation of *path1*, and optionally *path2*, etc., with exactly one
    directory separator (``os.sep``) inserted between components, unless *path2* is
    empty.  Note that on Windows, since there is a current directory for each drive,
-   :func:`os.path.join("c:", "foo")` represents a path relative to the current
+   ``os.path.join("c:", "foo")`` represents a path relative to the current
    directory on drive :file:`C:` (:file:`c:foo`), not :file:`c:\\foo`.
 
 
 
    Split the pathname *path* into a pair ``(root, ext)``  such that ``root + ext ==
    path``, and *ext* is empty or begins with a period and contains at most one
-   period. Leading periods on the basename are  ignored; ``splitext.('.cshrc')``
+   period. Leading periods on the basename are  ignored; ``splitext('.cshrc')``
    returns  ``('.cshrc', '')``.
 
    .. versionchanged:: 2.6
-      Earlier versions could produce an empty root when the only period was the first
-      character.
+      Earlier versions could produce an empty root when the only period was the
+      first character.
 
 
 .. function:: splitunc(path)

Doc-3k/library/pickle.rst

 * Protocol version 2 was introduced in Python 2.3.  It provides much more
   efficient pickling of new-style classes.
 
-Refer to PEP 307 for more information.
+Refer to :pep:`307` for more information.
 
 If a *protocol* is not specified, protocol 0 is used. If *protocol* is specified
 as a negative value or :const:`HIGHEST_PROTOCOL`, the highest protocol version
    This takes a file-like object to which it will write a pickle data stream.
 
    If the *protocol* parameter is omitted, protocol 0 is used. If *protocol* is
-   specified as a negative value, the highest protocol version will be used.
+   specified as a negative value or :const:`HIGHEST_PROTOCOL`, the highest
+   protocol version will be used.
 
    .. versionchanged:: 2.3
       Introduced the *protocol* parameter.
    Read a pickled object representation from the open file object given in the
    constructor, and return the reconstituted object hierarchy specified therein.
 
+   This method automatically determines whether the data stream was written in
+   binary mode or not.
+
 
 .. method:: Unpickler.noload()
 
 reading resumes from the last location. The :meth:`__setstate__` and
 :meth:`__getstate__` methods are used to implement this behavior. ::
 
+   #!/usr/local/bin/python
+
    class TextReader:
        """Print and number lines in a text file."""
        def __init__(self, file):
    >>> obj = TextReader.TextReader("TextReader.py")
    >>> obj.readline()
    '1: #!/usr/local/bin/python'
-   >>> # (more invocations of obj.readline() here)
-   ... obj.readline()
-   '7: class TextReader:'
+   >>> obj.readline()
+   '2: '
+   >>> obj.readline()
+   '3: class TextReader:'
    >>> import pickle
-   >>> pickle.dump(obj,open('save.p', 'wb'))
+   >>> pickle.dump(obj, open('save.p', 'wb'))
 
 If you want to see that :mod:`pickle` works across Python processes, start
 another Python session, before continuing.  What follows can happen from either
    >>> import pickle
    >>> reader = pickle.load(open('save.p', 'rb'))
    >>> reader.readline()
-   '8:     "Print and number lines in a text file."'
+   '4:     """Print and number lines in a text file."""'
 
 
 .. seealso::

Doc-3k/library/random.rst

    .. versionadded:: 2.1
 
    .. versionchanged:: 2.3
-      Instead of jumping to a specific state, *n* steps ahead, :meth:`jumpahead(n)`
+      Instead of jumping to a specific state, *n* steps ahead, ``jumpahead(n)``
       jumps to another state likely to be separated by many steps.
 
 
 
 .. function:: uniform(a, b)
 
-   Return a random real number *N* such that ``a <= N < b``.
+   Return a random floating point number *N* such that ``a <= N < b``.
 
 
 .. function:: betavariate(alpha, beta)
 
 .. function:: vonmisesvariate(mu, kappa)
 
-   *mu* is the mean angle, expressed in radians between 0 and 2\**pi*, and *kappa*
+   *mu* is the mean angle, expressed in radians between 0 and 2\*\ *pi*, and *kappa*
    is the concentration parameter, which must be greater than or equal to zero.  If
    *kappa* is equal to zero, this distribution reduces to a uniform random angle
-   over the range 0 to 2\**pi*.
+   over the range 0 to 2\*\ *pi*.
 
 
 .. function:: paretovariate(alpha)
    Weibull distribution.  *alpha* is the scale parameter and *beta* is the shape
    parameter.
 
+
 Alternative Generators:
 
-
 .. class:: WichmannHill([seed])
 
    Class that implements the Wichmann-Hill algorithm as the core generator. Has all

Doc-3k/library/shutil.rst

 .. function:: copy2(src, dst)
 
    Similar to :func:`copy`, but last access time and last modification time are
-   copied as well.  This is similar to the Unix command :program:`cp` :option:`-p`.
+   copied as well.  This is similar to the Unix command :program:`cp -p`.
 
 
 .. function:: copytree(src, dst[, symlinks])
 above, with the docstring omitted.  It demonstrates many of the other functions
 provided by this module. ::
 
-   def copytree(src, dst, symlinks=0):
+   def copytree(src, dst, symlinks=False):
        names = os.listdir(src)
-       os.mkdir(dst)
+       os.makedirs(dst)
+       errors = []
        for name in names:
            srcname = os.path.join(src, name)
            dstname = os.path.join(dst, name)
                    copytree(srcname, dstname, symlinks)
                else:
                    copy2(srcname, dstname)
+               # XXX What about devices, sockets etc.?
            except (IOError, os.error) as why:
-               print "Can't copy %s to %s: %s" % (`srcname`, `dstname`, str(why))
+               errors.append((srcname, dstname, str(why)))
+           # catch the Error from the recursive copytree so that we can
+           # continue with other files
+           except Error as err:
+               errors.extend(err.args[0])
+       try:
+           copystat(src, dst)
+       except WindowsError:
+           # can't copy file access times on Windows
+           pass
+       except OSError as why:
+           errors.extend((src, dst, str(why)))
+       if errors:
+           raise Error, errors
 

Doc-3k/library/tempfile.rst

 
 .. function:: mkstemp([suffix[, prefix[, dir[, text]]]])
 
-   Creates a temporary file in the most secure manner possible.  There are no race
-   conditions in the file's creation, assuming that the platform properly
-   implements the :const:`O_EXCL` flag for :func:`os.open`.  The file is readable
-   and writable only by the creating user ID.  If the platform uses permission bits
-   to indicate whether a file is executable, the file is executable by no one.  The
-   file descriptor is not inherited by child processes.
+   Creates a temporary file in the most secure manner possible.  There are no
+   race conditions in the file's creation, assuming that the platform properly
+   implements the :const:`os.O_EXCL` flag for :func:`os.open`.  The file is
+   readable and writable only by the creating user ID.  If the platform uses
+   permission bits to indicate whether a file is executable, the file is
+   executable by no one.  The file descriptor is not inherited by child
+   processes.
 
    Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible for
    deleting the temporary file when done with it.
       * On RiscOS, the directory named by the :envvar:`Wimp$ScrapDir` environment
         variable.
 
-      * On Windows, the directories :file:`C:$\\TEMP`, :file:`C:$\\TMP`,
+      * On Windows, the directories :file:`C:\\TEMP`, :file:`C:\\TMP`,
         :file:`\\TEMP`, and :file:`\\TMP`, in that order.
 
       * On all other platforms, the directories :file:`/tmp`, :file:`/var/tmp`, and
 .. function:: gettempdir()
 
    Return the directory currently selected to create temporary files in. If
-   ``tempdir`` is not ``None``, this simply returns its contents; otherwise, the
-   search described above is performed, and the result returned.
+   :data:`tempdir` is not ``None``, this simply returns its contents; otherwise,
+   the search described above is performed, and the result returned.
 
 
 .. data:: template
 - look at the old tools/ scripts, what functionality should be rewritten
 - add search via Xapian?
 - optionally have a contents tree view in the sidebar (AJAX based)?
+- .. caveat?