[Python-checkins] r88564 - in python/branches/release27-maint: Doc/c-api/init.rst Doc/c-api/list.rst Doc/library/difflib.rst Doc/library/logging.rst Doc/library/pickle.rst Doc/library/unittest.rst Doc/library/zipfile.rst Doc/reference/expressions.rst Lib/_weakrefset.py Lib/pydoc.py Lib/test/test_weakset.py Misc/NEWS

georg.brandl python-checkins at python.org
Fri Feb 25 11:39:23 CET 2011


Author: georg.brandl
Date: Fri Feb 25 11:39:23 2011
New Revision: 88564

Log:
Merged revisions 86881,86887,86913-86915,86933,86943,86960,86964,86974,86980,86996,87008 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86881 | georg.brandl | 2010-11-30 08:43:28 +0100 (Di, 30 Nov 2010) | 1 line
  
  #10584: fix bad links.
........
  r86887 | georg.brandl | 2010-11-30 15:57:54 +0100 (Di, 30 Nov 2010) | 1 line
  
  Fix typo.
........
  r86913 | georg.brandl | 2010-12-01 16:32:43 +0100 (Mi, 01 Dez 2010) | 1 line
  
  Add missing word, and add a better reference to the actual function.
........
  r86914 | georg.brandl | 2010-12-01 16:36:33 +0100 (Mi, 01 Dez 2010) | 1 line
  
  #10594: fix parameter names in PyList API docs.
........
  r86915 | georg.brandl | 2010-12-01 16:44:25 +0100 (Mi, 01 Dez 2010) | 1 line
  
  Fix some markup and style in the unittest docs.
........
  r86933 | georg.brandl | 2010-12-02 19:02:01 +0100 (Do, 02 Dez 2010) | 1 line
  
  #10597: fix Py_SetPythonHome docs by pointing to where the meaning of PYTHONHOME is already documented.
........
  r86943 | georg.brandl | 2010-12-02 23:35:25 +0100 (Do, 02 Dez 2010) | 1 line
  
  Re-add accidentally removed line.
........
  r86960 | georg.brandl | 2010-12-03 08:55:44 +0100 (Fr, 03 Dez 2010) | 1 line
  
  #10360: catch TypeError in WeakSet.__contains__, just like WeakKeyDictionary does.
........
  r86964 | georg.brandl | 2010-12-03 10:58:38 +0100 (Fr, 03 Dez 2010) | 1 line
  
  #10549: fix interface of docclass() for text documenter.
........
  r86974 | georg.brandl | 2010-12-03 16:30:09 +0100 (Fr, 03 Dez 2010) | 1 line
  
  Markup consistency fixes.
........
  r86980 | georg.brandl | 2010-12-03 18:19:27 +0100 (Fr, 03 Dez 2010) | 1 line
  
  Fix punctuation.
........
  r86996 | georg.brandl | 2010-12-03 20:56:42 +0100 (Fr, 03 Dez 2010) | 1 line
  
  Fix indentation.
........
  r87008 | georg.brandl | 2010-12-04 10:04:04 +0100 (Sa, 04 Dez 2010) | 1 line
  
  Fix typo.
........


Modified:
   python/branches/release27-maint/   (props changed)
   python/branches/release27-maint/Doc/c-api/init.rst
   python/branches/release27-maint/Doc/c-api/list.rst
   python/branches/release27-maint/Doc/library/difflib.rst
   python/branches/release27-maint/Doc/library/logging.rst
   python/branches/release27-maint/Doc/library/pickle.rst
   python/branches/release27-maint/Doc/library/unittest.rst
   python/branches/release27-maint/Doc/library/zipfile.rst
   python/branches/release27-maint/Doc/reference/expressions.rst
   python/branches/release27-maint/Lib/_weakrefset.py
   python/branches/release27-maint/Lib/pydoc.py
   python/branches/release27-maint/Lib/test/test_weakset.py
   python/branches/release27-maint/Misc/NEWS

Modified: python/branches/release27-maint/Doc/c-api/init.rst
==============================================================================
--- python/branches/release27-maint/Doc/c-api/init.rst	(original)
+++ python/branches/release27-maint/Doc/c-api/init.rst	Fri Feb 25 11:39:23 2011
@@ -319,8 +319,9 @@
 .. cfunction:: void Py_SetPythonHome(char *home)
 
    Set the default "home" directory, that is, the location of the standard
-   Python libraries.  The libraries are searched in
-   :file:`{home}/lib/python{version}` and :file:`{home}/lib/python{version}`.
+   Python libraries.  See :envvar:`PYTHONHOME` for the meaning of the
+   argument string.
+
    The argument should point to a zero-terminated character string in static
    storage whose contents will not change for the duration of the program's
    execution.  No code in the Python interpreter will change the contents of

Modified: python/branches/release27-maint/Doc/c-api/list.rst
==============================================================================
--- python/branches/release27-maint/Doc/c-api/list.rst	(original)
+++ python/branches/release27-maint/Doc/c-api/list.rst	Fri Feb 25 11:39:23 2011
@@ -42,7 +42,7 @@
 
    .. note::
 
-      If *length* is greater than zero, the returned list object's items are
+      If *len* is greater than zero, the returned list object's items are
       set to ``NULL``.  Thus you cannot use abstract API functions such as
       :cfunc:`PySequence_SetItem`  or expose the object to Python code before
       setting all items to a real object with :cfunc:`PyList_SetItem`.
@@ -75,9 +75,9 @@
 
 .. cfunction:: PyObject* PyList_GetItem(PyObject *list, Py_ssize_t index)
 
-   Return the object at position *pos* in the list pointed to by *p*.  The
+   Return the object at position *index* in the list pointed to by *list*.  The
    position must be positive, indexing from the end of the list is not
-   supported.  If *pos* is out of bounds, return *NULL* and set an
+   supported.  If *index* is out of bounds, return *NULL* and set an
    :exc:`IndexError` exception.
 
    .. versionchanged:: 2.5

Modified: python/branches/release27-maint/Doc/library/difflib.rst
==============================================================================
--- python/branches/release27-maint/Doc/library/difflib.rst	(original)
+++ python/branches/release27-maint/Doc/library/difflib.rst	Fri Feb 25 11:39:23 2011
@@ -368,7 +368,6 @@
 
    :class:`SequenceMatcher` objects have the following methods:
 
-
    .. method:: set_seqs(a, b)
 
       Set the two sequences to be compared.

Modified: python/branches/release27-maint/Doc/library/logging.rst
==============================================================================
--- python/branches/release27-maint/Doc/library/logging.rst	(original)
+++ python/branches/release27-maint/Doc/library/logging.rst	Fri Feb 25 11:39:23 2011
@@ -539,10 +539,7 @@
 unit tests and deliver logs which suit their requirements.
 
 .. versionadded:: 2.7
-
-The :class:`NullHandler` class was not present in previous versions, but is now
-included, so that it need not be defined in library code.
-
+   The :class:`NullHandler` class.
 
 
 Logging Levels
@@ -672,8 +669,7 @@
    more information.
 
 .. versionadded:: 2.7
-
-The :class:`NullHandler` class was not present in previous versions.
+   The :class:`NullHandler` class.
 
 The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler`
 classes are defined in the core logging package. The other handlers are
@@ -932,6 +928,7 @@
    which need to use custom logger behavior.
 
 
+
 .. seealso::
 
    :pep:`282` - A Logging System
@@ -1944,6 +1941,7 @@
 
       Outputs the record to the file.
 
+
 .. _null-handler:
 
 NullHandler
@@ -1955,12 +1953,10 @@
 does not do any formatting or output. It is essentially a "no-op" handler
 for use by library developers.
 
-
 .. class:: NullHandler()
 
    Returns a new instance of the :class:`NullHandler` class.
 
-
    .. method:: emit(record)
 
       This method does nothing.
@@ -2794,6 +2790,7 @@
    .. versionchanged:: 2.5
       *func* was added.
 
+
 .. _logger-adapter:
 
 LoggerAdapter Objects
@@ -2803,22 +2800,21 @@
 
 :class:`LoggerAdapter` instances are used to conveniently pass contextual
 information into logging calls. For a usage example , see the section on
-`adding contextual information to your logging output`__.
+:ref:`adding contextual information to your logging output <context-info>`.
 
-__ context-info_
 
 .. class:: LoggerAdapter(logger, extra)
 
-  Returns an instance of :class:`LoggerAdapter` initialized with an
-  underlying :class:`Logger` instance and a dict-like object.
+   Returns an instance of :class:`LoggerAdapter` initialized with an
+   underlying :class:`Logger` instance and a dict-like object.
 
-  .. method:: process(msg, kwargs)
+   .. method:: process(msg, kwargs)
 
-    Modifies the message and/or keyword arguments passed to a logging call in
-    order to insert contextual information. This implementation takes the object
-    passed as *extra* to the constructor and adds it to *kwargs* using key
-    'extra'. The return value is a (*msg*, *kwargs*) tuple which has the
-    (possibly modified) versions of the arguments passed in.
+      Modifies the message and/or keyword arguments passed to a logging call in
+      order to insert contextual information. This implementation takes the object
+      passed as *extra* to the constructor and adds it to *kwargs* using key
+      'extra'. The return value is a (*msg*, *kwargs*) tuple which has the
+      (possibly modified) versions of the arguments passed in.
 
 In addition to the above, :class:`LoggerAdapter` supports all the logging
 methods of :class:`Logger`, i.e. :meth:`debug`, :meth:`info`, :meth:`warning`,

Modified: python/branches/release27-maint/Doc/library/pickle.rst
==============================================================================
--- python/branches/release27-maint/Doc/library/pickle.rst	(original)
+++ python/branches/release27-maint/Doc/library/pickle.rst	Fri Feb 25 11:39:23 2011
@@ -53,7 +53,7 @@
 objects.  :mod:`marshal` exists primarily to support Python's :file:`.pyc`
 files.
 
-The :mod:`pickle` module differs from :mod:`marshal` several significant ways:
+The :mod:`pickle` module differs from :mod:`marshal` in several significant ways:
 
 * The :mod:`pickle` module keeps track of the objects it has already serialized,
   so that later references to the same object won't be serialized again.

Modified: python/branches/release27-maint/Doc/library/unittest.rst
==============================================================================
--- python/branches/release27-maint/Doc/library/unittest.rst	(original)
+++ python/branches/release27-maint/Doc/library/unittest.rst	Fri Feb 25 11:39:23 2011
@@ -1752,10 +1752,8 @@
 load_tests Protocol
 ###################
 
-
 .. versionadded:: 2.7
 
-
 Modules or packages can customize how tests are loaded from them during normal
 test runs or test discovery by implementing a function called ``load_tests``.
 

Modified: python/branches/release27-maint/Doc/library/zipfile.rst
==============================================================================
--- python/branches/release27-maint/Doc/library/zipfile.rst	(original)
+++ python/branches/release27-maint/Doc/library/zipfile.rst	Fri Feb 25 11:39:23 2011
@@ -176,8 +176,8 @@
    .. note::
 
       The file-like object is read-only and provides the following methods:
-      :meth:`read`, :meth:`readline`, :meth:`readlines`, :meth:`__iter__`,
-      :meth:`next`.
+      :meth:`!read`, :meth:`!readline`, :meth:`!readlines`, :meth:`!__iter__`,
+      :meth:`!next`.
 
    .. note::
 

Modified: python/branches/release27-maint/Doc/reference/expressions.rst
==============================================================================
--- python/branches/release27-maint/Doc/reference/expressions.rst	(original)
+++ python/branches/release27-maint/Doc/reference/expressions.rst	Fri Feb 25 11:39:23 2011
@@ -1392,8 +1392,8 @@
    true numerically due to roundoff.  For example, and assuming a platform on which
    a Python float is an IEEE 754 double-precision number, in order that ``-1e-100 %
    1e100`` have the same sign as ``1e100``, the computed result is ``-1e-100 +
-   1e100``, which is numerically exactly equal to ``1e100``.  Function :func:`fmod`
-   in the :mod:`math` module returns a result whose sign matches the sign of the
+   1e100``, which is numerically exactly equal to ``1e100``.  The function
+   :func:`math.fmod` returns a result whose sign matches the sign of the
    first argument instead, and so returns ``-1e-100`` in this case. Which approach
    is more appropriate depends on the application.
 
@@ -1423,7 +1423,8 @@
    the :keyword:`is` operator, like those involving comparisons between instance
    methods, or constants.  Check their documentation for more info.
 
-.. [#] The ``%`` is also used for string formatting; the same precedence applies.
+.. [#] The ``%`` operator is also used for string formatting; the same
+   precedence applies.
 
 .. [#] The power operator ``**`` binds less tightly than an arithmetic or
    bitwise unary operator on its right, that is, ``2**-1`` is ``0.5``.

Modified: python/branches/release27-maint/Lib/_weakrefset.py
==============================================================================
--- python/branches/release27-maint/Lib/_weakrefset.py	(original)
+++ python/branches/release27-maint/Lib/_weakrefset.py	Fri Feb 25 11:39:23 2011
@@ -66,7 +66,11 @@
         return sum(x() is not None for x in self.data)
 
     def __contains__(self, item):
-        return ref(item) in self.data
+        try:
+            wr = ref(item)
+        except TypeError:
+            return False
+        return wr in self.data
 
     def __reduce__(self):
         return (self.__class__, (list(self),),

Modified: python/branches/release27-maint/Lib/pydoc.py
==============================================================================
--- python/branches/release27-maint/Lib/pydoc.py	(original)
+++ python/branches/release27-maint/Lib/pydoc.py	Fri Feb 25 11:39:23 2011
@@ -1113,7 +1113,7 @@
             result = result + self.section('CREDITS', str(object.__credits__))
         return result
 
-    def docclass(self, object, name=None, mod=None):
+    def docclass(self, object, name=None, mod=None, *ignored):
         """Produce text documentation for a given class object."""
         realname = object.__name__
         name = name or realname

Modified: python/branches/release27-maint/Lib/test/test_weakset.py
==============================================================================
--- python/branches/release27-maint/Lib/test/test_weakset.py	(original)
+++ python/branches/release27-maint/Lib/test/test_weakset.py	Fri Feb 25 11:39:23 2011
@@ -62,7 +62,8 @@
     def test_contains(self):
         for c in self.letters:
             self.assertEqual(c in self.s, c in self.d)
-        self.assertRaises(TypeError, self.s.__contains__, [[]])
+        # 1 is not weakref'able, but that TypeError is caught by __contains__
+        self.assertNotIn(1, self.s)
         self.assertIn(self.obj, self.fs)
         del self.obj
         self.assertNotIn(SomeClass('F'), self.fs)

Modified: python/branches/release27-maint/Misc/NEWS
==============================================================================
--- python/branches/release27-maint/Misc/NEWS	(original)
+++ python/branches/release27-maint/Misc/NEWS	Fri Feb 25 11:39:23 2011
@@ -41,6 +41,13 @@
   4GB, even on 32-bit builds.  Initial patch by Ross Lagerwall, adapted for
   32-bit Windows.
 
+- Issue #10360: In WeakSet, do not raise TypeErrors when testing for
+  membership of non-weakrefable objects.
+
+- Issue #10549: Fix pydoc traceback when text-documenting certain classes.
+
+- Issue #940286: pydoc.Helper.help() ignores input/output init parameters.
+
 - Issue #11171: Fix detection of config/Makefile when --prefix !=
   --exec-prefix, which caused Python to not start.
 


More information about the Python-checkins mailing list