[Python-checkins] cpython (merge 2.7 -> 2.7): Branch merge

eric.araujo python-checkins at python.org
Fri Jul 29 14:38:05 CEST 2011


http://hg.python.org/cpython/rev/5d0062918032
changeset:   71593:5d0062918032
branch:      2.7
parent:      71549:8328fe952303
parent:      71592:8b816bb2969b
user:        Éric Araujo <merwok at netwok.org>
date:        Fri Jul 29 14:23:13 2011 +0200
summary:
  Branch merge

files:
  .bzrignore                           |    1 +
  .hgignore                            |    3 +-
  Doc/ACKS.txt                         |    1 +
  Doc/c-api/veryhigh.rst               |    2 +-
  Doc/distutils/apiref.rst             |    4 +-
  Doc/glossary.rst                     |   11 +++--
  Doc/install/index.rst                |    2 +-
  Doc/library/__builtin__.rst          |    4 +-
  Doc/library/abc.rst                  |    4 +-
  Doc/library/collections.rst          |   11 +++--
  Doc/library/constants.rst            |    2 +
  Doc/library/functions.rst            |    2 +-
  Doc/library/numbers.rst              |    6 +-
  Doc/library/ossaudiodev.rst          |    2 +-
  Doc/library/profile.rst              |   24 ------------
  Doc/library/shutil.rst               |   27 ++++++++-----
  Doc/license.rst                      |   29 ---------------
  Doc/tools/sphinxext/susp-ignored.csv |    1 -
  Doc/tutorial/classes.rst             |   28 +++++++-------
  Doc/tutorial/interpreter.rst         |    2 +
  Lib/pstats.py                        |    4 --
  Tools/scripts/analyze_dxp.py         |    1 +
  Tools/scripts/cleanfuture.py         |  Bin 
  Tools/scripts/combinerefs.py         |  Bin 
  Tools/scripts/db2pickle.py           |  Bin 
  Tools/scripts/diff.py                |    1 +
  Tools/scripts/find_recursionlimit.py |  Bin 
  Tools/scripts/hotshotmain.py         |  Bin 
  Tools/scripts/mailerdaemon.py        |    1 +
  Tools/scripts/md5sum.py              |  Bin 
  Tools/scripts/patchcheck.py          |    1 +
  Tools/scripts/pickle2db.py           |  Bin 
  Tools/scripts/pysource.py            |  Bin 
  Tools/scripts/redemo.py              |    1 +
  34 files changed, 69 insertions(+), 106 deletions(-)


diff --git a/.bzrignore b/.bzrignore
--- a/.bzrignore
+++ b/.bzrignore
@@ -13,6 +13,7 @@
 platform
 pyconfig.h
 libpython*.a
+libpython*.so*
 python.exe
 python-gdb.py
 reflog.txt
diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -38,14 +38,13 @@
 syntax: glob
 python.exe-gdb.py
 libpython*.a
+libpython*.so*
 *.swp
 *.o
 *.pyc
 *.pyo
 *.pyd
 *.cover
-*.orig
-*.rej
 *~
 Lib/lib2to3/*.pickle
 Lib/test/data/*
diff --git a/Doc/ACKS.txt b/Doc/ACKS.txt
--- a/Doc/ACKS.txt
+++ b/Doc/ACKS.txt
@@ -199,6 +199,7 @@
    * Kalle Svensson
    * Jim Tittsler
    * David Turner
+   * Sandro Tosi
    * Ville Vainio
    * Martijn Vries
    * Charles G. Waldman
diff --git a/Doc/c-api/veryhigh.rst b/Doc/c-api/veryhigh.rst
--- a/Doc/c-api/veryhigh.rst
+++ b/Doc/c-api/veryhigh.rst
@@ -32,7 +32,7 @@
    prepared exactly as those which are passed to a C program's :cfunc:`main`
    function.  It is important to note that the argument list may be modified (but
    the contents of the strings pointed to by the argument list are not). The return
-   value will be ```0``` if the interpreter exits normally (ie, without an
+   value will be ``0`` if the interpreter exits normally (ie, without an
    exception), ``1`` if the interpreter exits due to an exception, or ``2``
    if the parameter list does not represent a valid Python command line.
 
diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst
--- a/Doc/distutils/apiref.rst
+++ b/Doc/distutils/apiref.rst
@@ -72,8 +72,8 @@
    |                    | be built                       | :class:`distutils.core.Extension`                           |
    +--------------------+--------------------------------+-------------------------------------------------------------+
    | *classifiers*      | A list of categories for the   | The list of available                                       |
-   |                    | package                        | categorizations is at                                       |
-   |                    |                                | http://pypi.python.org/pypi?:action=list_classifiers.       |
+   |                    | package                        | categorizations is available on `PyPI                       |
+   |                    |                                | <http://pypi.python.org/pypi?:action=list_classifiers>`_.   |
    +--------------------+--------------------------------+-------------------------------------------------------------+
    | *distclass*        | the :class:`Distribution`      | A subclass of                                               |
    |                    | class to use                   | :class:`distutils.core.Distribution`                        |
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -27,12 +27,13 @@
       :ref:`2to3-reference`.
 
    abstract base class
-      :ref:`abstract-base-classes` complement :term:`duck-typing` by
+      Abstract base classes complement :term:`duck-typing` by
       providing a way to define interfaces when other techniques like
-      :func:`hasattr` would be clumsy. Python comes with many built-in ABCs for
+      :func:`hasattr` would be clumsy or subtly wrong (for example with
+      :ref:`magic methods <new-style-special-lookup>`). Python comes with many built-in ABCs for
       data structures (in the :mod:`collections` module), numbers (in the
       :mod:`numbers` module), and streams (in the :mod:`io` module). You can
-      create your own ABC with the :mod:`abc` module.
+      create your own ABCs with the :mod:`abc` module.
 
    argument
       A value passed to a function or method, assigned to a named local
@@ -424,8 +425,8 @@
    mapping
       A container object that supports arbitrary key lookups and implements the
       methods specified in the :class:`Mapping` or :class:`MutableMapping`
-      :ref:`abstract base classes <abstract-base-classes>`. Examples include
-      :class:`dict`, :class:`collections.defaultdict`,
+      :ref:`abstract base classes <collections-abstract-base-classes>`.  Examples
+      include :class:`dict`, :class:`collections.defaultdict`,
       :class:`collections.OrderedDict` and :class:`collections.Counter`.
 
    metaclass
diff --git a/Doc/install/index.rst b/Doc/install/index.rst
--- a/Doc/install/index.rst
+++ b/Doc/install/index.rst
@@ -72,7 +72,7 @@
 do the obvious thing with it: run it if it's an executable installer, ``rpm
 --install`` it if it's an RPM, etc.  You don't need to run Python or a setup
 script, you don't need to compile anything---you might not even need to read any
-instructions (although it's always a good idea to do so anyways).
+instructions (although it's always a good idea to do so anyway).
 
 Of course, things will not always be that easy.  You might be interested in a
 module distribution that doesn't have an easy-to-use installer for your
diff --git a/Doc/library/__builtin__.rst b/Doc/library/__builtin__.rst
--- a/Doc/library/__builtin__.rst
+++ b/Doc/library/__builtin__.rst
@@ -8,7 +8,9 @@
 
 This module provides direct access to all 'built-in' identifiers of Python; for
 example, ``__builtin__.open`` is the full name for the built-in function
-:func:`open`.
+:func:`open`.  See :ref:`built-in-funcs` and :ref:`built-in-consts` for
+documentation.
+
 
 This module is not normally accessed explicitly by most applications, but can be
 useful in modules that provide objects with the same name as a built-in value,
diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst
--- a/Doc/library/abc.rst
+++ b/Doc/library/abc.rst
@@ -9,8 +9,8 @@
 
 .. versionadded:: 2.6
 
-This module provides the infrastructure for defining an :term:`abstract base
-class` (ABCs) in Python, as outlined in :pep:`3119`; see the PEP for why this
+This module provides the infrastructure for defining :term:`abstract base
+classes <abstract base class>` (ABCs) in Python, as outlined in :pep:`3119`; see the PEP for why this
 was added to Python. (See also :pep:`3141` and the :mod:`numbers` module
 regarding a type hierarchy for numbers based on ABCs.)
 
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -28,7 +28,7 @@
 =====================   ====================================================================  ===========================
 
 In addition to the concrete container classes, the collections module provides
-:ref:`abstract-base-classes` that can be used to test whether a class provides a
+:ref:`collections-abstract-base-classes` that can be used to test whether a class provides a
 particular interface, for example, whether it is hashable or a mapping.
 
 .. seealso::
@@ -851,8 +851,8 @@
 original insertion position is changed and moved to the end::
 
     class LastUpdatedOrderedDict(OrderedDict):
+        'Store items in the order the keys were last added'
 
-        'Store items in the order the keys were last added'
         def __setitem__(self, key, value):
             if key in self:
                 del self[key]
@@ -871,10 +871,10 @@
             return self.__class__, (OrderedDict(self),)
 
 
-.. _abstract-base-classes:
+.. _collections-abstract-base-classes:
 
-ABCs - abstract base classes
-----------------------------
+Collections Abstract Base Classes
+---------------------------------
 
 The collections module offers the following :term:`ABCs <abstract base class>`:
 
@@ -888,7 +888,7 @@
 :class:`Sized`                                    ``__len__``
 :class:`Callable`                                 ``__call__``
 
-:class:`Sequence`          :class:`Sized`,        ``__getitem__``         ``__contains__``. ``__iter__``, ``__reversed__``,
+:class:`Sequence`          :class:`Sized`,        ``__getitem__``         ``__contains__``, ``__iter__``, ``__reversed__``,
                            :class:`Iterable`,                             ``index``, and ``count``
                            :class:`Container`
 
diff --git a/Doc/library/constants.rst b/Doc/library/constants.rst
--- a/Doc/library/constants.rst
+++ b/Doc/library/constants.rst
@@ -1,3 +1,5 @@
+.. _built-in-consts:
+
 Built-in Constants
 ==================
 
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -583,7 +583,7 @@
    Two objects with non-overlapping lifetimes may have the same :func:`id`
    value.
 
-   .. impl-detail:: This is the address of the object.
+   .. impl-detail:: This is the address of the object in memory.
 
 
 .. function:: input([prompt])
diff --git a/Doc/library/numbers.rst b/Doc/library/numbers.rst
--- a/Doc/library/numbers.rst
+++ b/Doc/library/numbers.rst
@@ -7,9 +7,9 @@
 .. versionadded:: 2.6
 
 
-The :mod:`numbers` module (:pep:`3141`) defines a hierarchy of numeric abstract
-base classes which progressively define more operations.  None of the types
-defined in this module can be instantiated.
+The :mod:`numbers` module (:pep:`3141`) defines a hierarchy of numeric
+:term:`abstract base classes <abstract base class>` which progressively define
+more operations.  None of the types defined in this module can be instantiated.
 
 
 .. class:: Number
diff --git a/Doc/library/ossaudiodev.rst b/Doc/library/ossaudiodev.rst
--- a/Doc/library/ossaudiodev.rst
+++ b/Doc/library/ossaudiodev.rst
@@ -17,7 +17,7 @@
    ALSA is in the standard kernel as of 2.5.x.  Presumably if you
    use ALSA, you'll have to make sure its OSS compatibility layer
    is active to use ossaudiodev, but you're gonna need it for the vast
-   majority of Linux audio apps anyways.
+   majority of Linux audio apps anyway.
 
    Sounds like things are also complicated for other BSDs.  In response
    to my python-dev query, Thomas Wouters said:
diff --git a/Doc/library/profile.rst b/Doc/library/profile.rst
--- a/Doc/library/profile.rst
+++ b/Doc/library/profile.rst
@@ -10,29 +10,6 @@
 .. module:: profile
    :synopsis: Python source profiler.
 
-.. index:: single: InfoSeek Corporation
-
-Copyright © 1994, by InfoSeek Corporation, all rights reserved.
-
-Written by James Roskind. [#]_
-
-Permission to use, copy, modify, and distribute this Python software and its
-associated documentation for any purpose (subject to the restriction in the
-following sentence) without fee is hereby granted, provided that the above
-copyright notice appears in all copies, and that both that copyright notice and
-this permission notice appear in supporting documentation, and that the name of
-InfoSeek not be used in advertising or publicity pertaining to distribution of
-the software without specific, written prior permission.  This permission is
-explicitly restricted to the copying and modification of the software to remain
-in Python, compiled Python, or other languages (such as C) wherein the modified
-or derived code is exclusively imported into a Python module.
-
-INFOSEEK CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT
-SHALL INFOSEEK CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 .. _profiler-introduction:
 
@@ -65,7 +42,6 @@
    :mod:`cProfile`.  Adds significant overhead to profiled programs.
    If you're trying to extend
    the profiler in some way, the task might be easier with this module.
-   Copyright © 1994, by InfoSeek Corporation.
 
    .. versionchanged:: 2.4
       Now also reports the time spent in calls to built-in functions and methods.
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst
--- a/Doc/library/shutil.rst
+++ b/Doc/library/shutil.rst
@@ -161,24 +161,31 @@
 
 .. function:: move(src, dst)
 
-   Recursively move a file or directory to another location.
+   Recursively move a file or directory (*src*) to another location (*dst*).
 
-   Uses :func:`os.rename` to perform the move. If it fails, for reasons such as
-   when *src* and *dst* are on different filesystems or in case of windows where
-   rename is not supported when *dst* exists, fallback to copying *src* (with
-   :func:`copy2`) to the *dst* and then remove *src*.
+   If the destination is a directory or a symlink to a directory, then *src* is
+   moved inside that directory.
+
+   The destination directory must not already exist.  If the destination already
+   exists but is not a directory, it may be overwritten depending on
+   :func:`os.rename` semantics.
+
+   If the destination is on the current filesystem, then :func:`os.rename` is
+   used.  Otherwise, *src* is copied (using :func:`copy2`) to *dst* and then
+   removed.
 
    .. versionadded:: 2.3
 
 
 .. exception:: Error
 
-   This exception collects exceptions that raised during a multi-file operation. For
-   :func:`copytree`, the exception argument is a list of 3-tuples (*srcname*,
-   *dstname*, *exception*).
+   This exception collects exceptions that are raised during a multi-file
+   operation. For :func:`copytree`, the exception argument is a list of 3-tuples
+   (*srcname*, *dstname*, *exception*).
 
    .. versionadded:: 2.3
 
+
 .. _shutil-example:
 
 copytree example
@@ -277,7 +284,7 @@
 
 .. function:: get_archive_formats()
 
-   Returns a list of supported formats for archiving.
+   Return a list of supported formats for archiving.
    Each element of the returned sequence is a tuple ``(name, description)``
 
    By default :mod:`shutil` provides these formats:
@@ -295,7 +302,7 @@
 
 .. function:: register_archive_format(name, function, [extra_args, [description]])
 
-   Registers an archiver for the format *name*. *function* is a callable that
+   Register an archiver for the format *name*. *function* is a callable that
    will be used to invoke the archiver.
 
    If given, *extra_args* is a sequence of ``(name, value)`` that will be
diff --git a/Doc/license.rst b/Doc/license.rst
--- a/Doc/license.rst
+++ b/Doc/license.rst
@@ -536,36 +536,6 @@
    PERFORMANCE OF THIS SOFTWARE.
 
 
-Profiling
----------
-
-The :mod:`profile` and :mod:`pstats` modules contain the following notice::
-
-   Copyright 1994, by InfoSeek Corporation, all rights reserved.
-   Written by James Roskind
-
-   Permission to use, copy, modify, and distribute this Python software
-   and its associated documentation for any purpose (subject to the
-   restriction in the following sentence) without fee is hereby granted,
-   provided that the above copyright notice appears in all copies, and
-   that both that copyright notice and this permission notice appear in
-   supporting documentation, and that the name of InfoSeek not be used in
-   advertising or publicity pertaining to distribution of the software
-   without specific, written prior permission.  This permission is
-   explicitly restricted to the copying and modification of the software
-   to remain in Python, compiled Python, or other languages (such as C)
-   wherein the modified or derived code is exclusively imported into a
-   Python module.
-
-   INFOSEEK CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-   SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-   FITNESS. IN NO EVENT SHALL INFOSEEK CORPORATION BE LIABLE FOR ANY
-   SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
-   RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
-   CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-   CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-
 Execution tracing
 -----------------
 
diff --git a/Doc/tools/sphinxext/susp-ignored.csv b/Doc/tools/sphinxext/susp-ignored.csv
--- a/Doc/tools/sphinxext/susp-ignored.csv
+++ b/Doc/tools/sphinxext/susp-ignored.csv
@@ -5,7 +5,6 @@
 c-api/sequence,,:i2,o[i1:i2] = v
 c-api/sequence,,:i2,del o[i1:i2]
 c-api/unicode,,:end,str[start:end]
-distutils/apiref,,:action,http://pypi.python.org/pypi?:action=list_classifiers
 distutils/setupscript,,::,
 extending/embedding,,:numargs,"if(!PyArg_ParseTuple(args, "":numargs""))"
 extending/extending,,:set,"if (PyArg_ParseTuple(args, ""O:set_callback"", &temp)) {"
diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst
--- a/Doc/tutorial/classes.rst
+++ b/Doc/tutorial/classes.rst
@@ -556,24 +556,24 @@
 Name mangling is helpful for letting subclasses override methods without
 breaking intraclass method calls.  For example::
 
-    class Mapping:
-        def __init__(self, iterable):
-            self.items_list = []
-            self.__update(iterable)
+   class Mapping:
+       def __init__(self, iterable):
+           self.items_list = []
+           self.__update(iterable)
 
-        def update(self, iterable):
-            for item in iterable:
-                self.items_list.append(item)
+       def update(self, iterable):
+           for item in iterable:
+               self.items_list.append(item)
 
-        __update = update   # private copy of original update() method
+       __update = update   # private copy of original update() method
 
-    class MappingSubclass(Mapping):
+   class MappingSubclass(Mapping):
 
-        def update(self, keys, values):
-            # provides new signature for update()
-            # but does not break __init__()
-            for item in zip(keys, values):
-                self.items_list.append(item)
+       def update(self, keys, values):
+           # provides new signature for update()
+           # but does not break __init__()
+           for item in zip(keys, values):
+               self.items_list.append(item)
 
 Note that the mangling rules are designed mostly to avoid accidents; it still is
 possible to access or modify a variable that is considered private.  This can
diff --git a/Doc/tutorial/interpreter.rst b/Doc/tutorial/interpreter.rst
--- a/Doc/tutorial/interpreter.rst
+++ b/Doc/tutorial/interpreter.rst
@@ -166,6 +166,8 @@
 suppressed.
 
 
+.. _tut-source-encoding:
+
 Source Code Encoding
 --------------------
 
diff --git a/Lib/pstats.py b/Lib/pstats.py
--- a/Lib/pstats.py
+++ b/Lib/pstats.py
@@ -1,13 +1,9 @@
 """Class for printing reports on profiled python code."""
 
-# Class for printing reports on profiled python code. rev 1.0  4/1/94
-#
 # Written by James Roskind
 # Based on prior profile module by Sjoerd Mullender...
 #   which was hacked somewhat by: Guido van Rossum
 
-"""Class for profiling Python code."""
-
 # Copyright Disney Enterprises, Inc.  All Rights Reserved.
 # Licensed to PSF under a Contributor Agreement
 #
diff --git a/Tools/scripts/analyze_dxp.py b/Tools/scripts/analyze_dxp.py
old mode 100644
new mode 100755
--- a/Tools/scripts/analyze_dxp.py
+++ b/Tools/scripts/analyze_dxp.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 """
 Some helper functions to analyze the output of sys.getdxp() (which is
 only available if Python was built with -DDYNAMIC_EXECUTION_PROFILE).
diff --git a/Tools/scripts/cleanfuture.py b/Tools/scripts/cleanfuture.py
old mode 100644
new mode 100755
diff --git a/Tools/scripts/combinerefs.py b/Tools/scripts/combinerefs.py
old mode 100644
new mode 100755
diff --git a/Tools/scripts/db2pickle.py b/Tools/scripts/db2pickle.py
old mode 100644
new mode 100755
diff --git a/Tools/scripts/diff.py b/Tools/scripts/diff.py
old mode 100644
new mode 100755
--- a/Tools/scripts/diff.py
+++ b/Tools/scripts/diff.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 """ Command line interface to difflib.py providing diffs in four formats:
 
 * ndiff:    lists every line and highlights interline changes.
diff --git a/Tools/scripts/find_recursionlimit.py b/Tools/scripts/find_recursionlimit.py
old mode 100644
new mode 100755
diff --git a/Tools/scripts/hotshotmain.py b/Tools/scripts/hotshotmain.py
old mode 100644
new mode 100755
diff --git a/Tools/scripts/mailerdaemon.py b/Tools/scripts/mailerdaemon.py
old mode 100644
new mode 100755
--- a/Tools/scripts/mailerdaemon.py
+++ b/Tools/scripts/mailerdaemon.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 """mailerdaemon - classes to parse mailer-daemon messages"""
 
 import rfc822
diff --git a/Tools/scripts/md5sum.py b/Tools/scripts/md5sum.py
old mode 100644
new mode 100755
diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py
old mode 100644
new mode 100755
--- a/Tools/scripts/patchcheck.py
+++ b/Tools/scripts/patchcheck.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 import re
 import sys
 import shutil
diff --git a/Tools/scripts/pickle2db.py b/Tools/scripts/pickle2db.py
old mode 100644
new mode 100755
diff --git a/Tools/scripts/pysource.py b/Tools/scripts/pysource.py
old mode 100644
new mode 100755
diff --git a/Tools/scripts/redemo.py b/Tools/scripts/redemo.py
old mode 100644
new mode 100755
--- a/Tools/scripts/redemo.py
+++ b/Tools/scripts/redemo.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 """Basic regular expression demostration facility (Perl style syntax)."""
 
 from Tkinter import *

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list