[Python-checkins] r79227 - in python/branches/release26-maint: Doc/extending/newtypes.rst Doc/faq/library.rst Doc/faq/windows.rst Doc/library/codecs.rst Doc/library/datetime.rst Doc/library/functions.rst Doc/library/gzip.rst Doc/library/index.rst Doc/library/logging.rst Doc/library/objects.rst Doc/library/pdb.rst Doc/library/stdtypes.rst Doc/library/subprocess.rst Doc/library/sys.rst Doc/tutorial/datastructures.rst Doc/tutorial/introduction.rst Doc/whatsnew/2.2.rst Misc/Porting

georg.brandl python-checkins at python.org
Sun Mar 21 20:34:26 CET 2010


Author: georg.brandl
Date: Sun Mar 21 20:34:26 2010
New Revision: 79227

Log:
Merged revisions 78859-78860,78952,79168-79169,79173,79176,79178-79179,79181,79184-79185,79192,79212 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78859 | georg.brandl | 2010-03-12 10:57:43 +0100 (Fr, 12 Mär 2010) | 1 line
  
  Get rid of backticks.
........
  r78860 | georg.brandl | 2010-03-12 11:02:03 +0100 (Fr, 12 Mär 2010) | 1 line
  
  Fix warnings from "make check".
........
  r78952 | georg.brandl | 2010-03-14 10:55:08 +0100 (So, 14 Mär 2010) | 1 line
  
  #8137: add iso-8859-16 to the standard encodings table.
........
  r79168 | georg.brandl | 2010-03-21 10:01:27 +0100 (So, 21 Mär 2010) | 1 line
  
  Fix some issues found by Jacques Ducasse on the docs list.
........
  r79169 | georg.brandl | 2010-03-21 10:02:01 +0100 (So, 21 Mär 2010) | 1 line
  
  Remove the "built-in objects" file.  It only contained two paragraphs of which only one contained useful information, which belongs in the ref manual however.
........
  r79173 | georg.brandl | 2010-03-21 10:09:38 +0100 (So, 21 Mär 2010) | 1 line
  
  Document that GzipFile supports iteration.
........
  r79176 | georg.brandl | 2010-03-21 10:17:41 +0100 (So, 21 Mär 2010) | 1 line
  
  Introduce copy by slicing, used in later chapters.
........
  r79178 | georg.brandl | 2010-03-21 10:28:16 +0100 (So, 21 Mär 2010) | 1 line
  
  Clarify that for shell=True, the shell PID will be the child PID.
........
  r79179 | georg.brandl | 2010-03-21 10:37:54 +0100 (So, 21 Mär 2010) | 1 line
  
  Mention inefficiency of lists as queues, add link to collections.deque discussion.
........
  r79181 | georg.brandl | 2010-03-21 10:51:16 +0100 (So, 21 Mär 2010) | 1 line
  
  Update os.kill() emulation example for Windows to use ctypes.
........
  r79184 | georg.brandl | 2010-03-21 10:58:36 +0100 (So, 21 Mär 2010) | 1 line
  
  Update text for newest US DST regulation.  The sample file already has the calculation right.
........
  r79185 | georg.brandl | 2010-03-21 11:02:47 +0100 (So, 21 Mär 2010) | 1 line
  
  Include structmember.h correctly.
........
  r79192 | georg.brandl | 2010-03-21 12:50:58 +0100 (So, 21 Mär 2010) | 1 line
  
  Remove leftover word.
........
  r79212 | georg.brandl | 2010-03-21 20:01:38 +0100 (So, 21 Mär 2010) | 1 line
  
  Fix plural.
........


Removed:
   python/branches/release26-maint/Doc/library/objects.rst
Modified:
   python/branches/release26-maint/   (props changed)
   python/branches/release26-maint/Doc/extending/newtypes.rst
   python/branches/release26-maint/Doc/faq/library.rst
   python/branches/release26-maint/Doc/faq/windows.rst
   python/branches/release26-maint/Doc/library/codecs.rst
   python/branches/release26-maint/Doc/library/datetime.rst
   python/branches/release26-maint/Doc/library/functions.rst
   python/branches/release26-maint/Doc/library/gzip.rst
   python/branches/release26-maint/Doc/library/index.rst
   python/branches/release26-maint/Doc/library/logging.rst
   python/branches/release26-maint/Doc/library/pdb.rst
   python/branches/release26-maint/Doc/library/stdtypes.rst
   python/branches/release26-maint/Doc/library/subprocess.rst
   python/branches/release26-maint/Doc/library/sys.rst
   python/branches/release26-maint/Doc/tutorial/datastructures.rst
   python/branches/release26-maint/Doc/tutorial/introduction.rst
   python/branches/release26-maint/Doc/whatsnew/2.2.rst
   python/branches/release26-maint/Misc/Porting

Modified: python/branches/release26-maint/Doc/extending/newtypes.rst
==============================================================================
--- python/branches/release26-maint/Doc/extending/newtypes.rst	(original)
+++ python/branches/release26-maint/Doc/extending/newtypes.rst	Sun Mar 21 20:34:26 2010
@@ -252,7 +252,7 @@
 
 We've added an extra include::
 
-   #include "structmember.h"
+   #include <structmember.h>
 
 This include provides declarations that we use to handle attributes, as
 described a bit later.

Modified: python/branches/release26-maint/Doc/faq/library.rst
==============================================================================
--- python/branches/release26-maint/Doc/faq/library.rst	(original)
+++ python/branches/release26-maint/Doc/faq/library.rst	Sun Mar 21 20:34:26 2010
@@ -205,7 +205,7 @@
        while 1:
            try:
                c = sys.stdin.read(1)
-               print "Got character", `c`
+               print "Got character", repr(c)
            except IOError: pass
    finally:
        termios.tcsetattr(fd, termios.TCSAFLUSH, oldterm)

Modified: python/branches/release26-maint/Doc/faq/windows.rst
==============================================================================
--- python/branches/release26-maint/Doc/faq/windows.rst	(original)
+++ python/branches/release26-maint/Doc/faq/windows.rst	Sun Mar 21 20:34:26 2010
@@ -441,13 +441,15 @@
 How do I emulate os.kill() in Windows?
 --------------------------------------
 
-Use win32api::
+To terminate a process, you can use ctypes::
+
+   import ctypes
 
    def kill(pid):
        """kill function for Win32"""
-       import win32api
-       handle = win32api.OpenProcess(1, 0, pid)
-       return (0 != win32api.TerminateProcess(handle, 0))
+       kernel32 = ctypes.windll.kernel32
+       handle = kernel32.OpenProcess(1, 0, pid)
+       return (0 != kernel32.TerminateProcess(handle, 0))
 
 
 Why does os.path.isdir() fail on NT shared directories?

Modified: python/branches/release26-maint/Doc/library/codecs.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/codecs.rst	(original)
+++ python/branches/release26-maint/Doc/library/codecs.rst	Sun Mar 21 20:34:26 2010
@@ -1035,11 +1035,13 @@
 +-----------------+--------------------------------+--------------------------------+
 | iso8859_10      | iso-8859-10, latin6, L6        | Nordic languages               |
 +-----------------+--------------------------------+--------------------------------+
-| iso8859_13      | iso-8859-13                    | Baltic languages               |
+| iso8859_13      | iso-8859-13, latin7, L7        | Baltic languages               |
 +-----------------+--------------------------------+--------------------------------+
 | iso8859_14      | iso-8859-14, latin8, L8        | Celtic languages               |
 +-----------------+--------------------------------+--------------------------------+
-| iso8859_15      | iso-8859-15                    | Western Europe                 |
+| iso8859_15      | iso-8859-15, latin9, L9        | Western Europe                 |
++-----------------+--------------------------------+--------------------------------+
+| iso8859_16      | iso-8859-16, latin10, L10      | South-Eastern Europe           |
 +-----------------+--------------------------------+--------------------------------+
 | johab           | cp1361, ms1361                 | Korean                         |
 +-----------------+--------------------------------+--------------------------------+

Modified: python/branches/release26-maint/Doc/library/datetime.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/datetime.rst	(original)
+++ python/branches/release26-maint/Doc/library/datetime.rst	Sun Mar 21 20:34:26 2010
@@ -1445,8 +1445,8 @@
 Note that there are unavoidable subtleties twice per year in a :class:`tzinfo`
 subclass accounting for both standard and daylight time, at the DST transition
 points.  For concreteness, consider US Eastern (UTC -0500), where EDT begins the
-minute after 1:59 (EST) on the first Sunday in April, and ends the minute after
-1:59 (EDT) on the last Sunday in October::
+minute after 1:59 (EST) on the second Sunday in March, and ends the minute after
+1:59 (EDT) on the first Sunday in November::
 
      UTC   3:MM  4:MM  5:MM  6:MM  7:MM  8:MM
      EST  22:MM 23:MM  0:MM  1:MM  2:MM  3:MM

Modified: python/branches/release26-maint/Doc/library/functions.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/functions.rst	(original)
+++ python/branches/release26-maint/Doc/library/functions.rst	Sun Mar 21 20:34:26 2010
@@ -336,7 +336,7 @@
    This function can also be used to execute arbitrary code objects (such as
    those created by :func:`compile`).  In this case pass a code object instead
    of a string.  If the code object has been compiled with ``'exec'`` as the
-   *kind* argument, :func:`eval`\'s return value will be ``None``.
+   *mode* argument, :func:`eval`\'s return value will be ``None``.
 
    Hints: dynamic execution of statements is supported by the :keyword:`exec`
    statement.  Execution of statements from a file is supported by the
@@ -1135,7 +1135,8 @@
    value is ``None``.
 
    *key* specifies a function of one argument that is used to extract a comparison
-   key from each list element: ``key=str.lower``.  The default value is ``None``.
+   key from each list element: ``key=str.lower``.  The default value is ``None``
+   (compare the elements directly).
 
    *reverse* is a boolean value.  If set to ``True``, then the list elements are
    sorted as if each comparison were reversed.

Modified: python/branches/release26-maint/Doc/library/gzip.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/gzip.rst	(original)
+++ python/branches/release26-maint/Doc/library/gzip.rst	Sun Mar 21 20:34:26 2010
@@ -58,6 +58,7 @@
    writing as *fileobj*, and retrieve the resulting memory buffer using the
    :class:`StringIO` object's :meth:`getvalue` method.
 
+   :class:`GzipFile` supports iteration.
 
 .. function:: open(filename[, mode[, compresslevel]])
 

Modified: python/branches/release26-maint/Doc/library/index.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/index.rst	(original)
+++ python/branches/release26-maint/Doc/library/index.rst	Sun Mar 21 20:34:26 2010
@@ -43,7 +43,6 @@
    intro.rst
    functions.rst
    constants.rst
-   objects.rst
    stdtypes.rst
    exceptions.rst
 

Modified: python/branches/release26-maint/Doc/library/logging.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/logging.rst	(original)
+++ python/branches/release26-maint/Doc/library/logging.rst	Sun Mar 21 20:34:26 2010
@@ -1210,12 +1210,12 @@
 :class:`Handler` subclass are passed to its :meth:`handleError` method.
 
 The default implementation of :meth:`handleError` in :class:`Handler` checks
-to see if a module-level variable, `raiseExceptions`, is set. If set, a
-traceback is printed to `sys.stderr`. If not set, the exception is swallowed.
+to see if a module-level variable, :data:`raiseExceptions`, is set. If set, a
+traceback is printed to :data:`sys.stderr`. If not set, the exception is swallowed.
 
-**Note:** The default value of `raiseExceptions` is `True`. This is because
+**Note:** The default value of :data:`raiseExceptions` is ``True``. This is because
 during development, you typically want to be notified of any exceptions that
-occur. It's advised that you set `raiseExceptions` to `False` for production
+occur. It's advised that you set :data:`raiseExceptions` to ``False`` for production
 usage.
 
 .. _context-info:

Deleted: python/branches/release26-maint/Doc/library/objects.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/objects.rst	Sun Mar 21 20:34:26 2010
+++ (empty file)
@@ -1,27 +0,0 @@
-
-.. _builtin:
-
-****************
-Built-in Objects
-****************
-
-.. index::
-   pair: built-in; types
-   pair: built-in; exceptions
-   pair: built-in; functions
-   pair: built-in; constants
-   single: symbol table
-
-Names for built-in exceptions and functions and a number of constants are found
-in a separate  symbol table.  This table is searched last when the interpreter
-looks up the meaning of a name, so local and global user-defined names can
-override built-in names.  Built-in types are described together here for easy
-reference.
-
-The tables in this chapter document the priorities of operators by listing them
-in order of ascending priority (within a table) and grouping operators that have
-the same priority in the same box. Binary operators of the same priority group
-from left to right. (Unary operators group from right to left, but there you
-have no real choice.)  See :ref:`operator-summary` for the complete picture on
-operator priorities.
-

Modified: python/branches/release26-maint/Doc/library/pdb.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/pdb.rst	(original)
+++ python/branches/release26-maint/Doc/library/pdb.rst	Sun Mar 21 20:34:26 2010
@@ -23,7 +23,7 @@
 
 The debugger is extensible --- it is actually defined as the class :class:`Pdb`.
 This is currently undocumented but easily understood by reading the source.  The
-extension interface uses the modules :mod:`bdb` (undocumented) and :mod:`cmd`.
+extension interface uses the modules :mod:`bdb` and :mod:`cmd`.
 
 The debugger's prompt is ``(Pdb)``. Typical usage to run a program under control
 of the debugger is::

Modified: python/branches/release26-maint/Doc/library/stdtypes.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/stdtypes.rst	(original)
+++ python/branches/release26-maint/Doc/library/stdtypes.rst	Sun Mar 21 20:34:26 2010
@@ -883,12 +883,12 @@
 
 .. method:: str.format(*args, **kwargs)
 
-   Perform a string formatting operation.  The *format_string* argument can
-   contain literal text or replacement fields delimited by braces ``{}``.  Each
-   replacement field contains either the numeric index of a positional argument,
-   or the name of a keyword argument.  Returns a copy of *format_string* where
-   each replacement field is replaced with the string value of the corresponding
-   argument.
+   Perform a string formatting operation.  The string on which this method is
+   called can contain literal text or replacement fields delimited by braces
+   ``{}``.  Each replacement field contains either the numeric index of a
+   positional argument, or the name of a keyword argument.  Returns a copy of
+   the string where each replacement field is replaced with the string value of
+   the corresponding argument.
 
       >>> "The sum of 1 + 2 is {0}".format(1+2)
       'The sum of 1 + 2 is 3'

Modified: python/branches/release26-maint/Doc/library/subprocess.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/subprocess.rst	(original)
+++ python/branches/release26-maint/Doc/library/subprocess.rst	Sun Mar 21 20:34:26 2010
@@ -339,6 +339,9 @@
 
    The process ID of the child process.
 
+   Note that if you set the *shell* argument to ``True``, this is the process ID
+   of the spawned shell.
+
 
 .. attribute:: Popen.returncode
 

Modified: python/branches/release26-maint/Doc/library/sys.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/sys.rst	(original)
+++ python/branches/release26-maint/Doc/library/sys.rst	Sun Mar 21 20:34:26 2010
@@ -405,7 +405,7 @@
    specific.
 
    If given, *default* will be returned if the object does not provide means to
-   retrieve the size.  Otherwise a `TypeError` will be raised.
+   retrieve the size.  Otherwise a :exc:`TypeError` will be raised.
 
    :func:`getsizeof` calls the object's ``__sizeof__`` method and adds an
    additional garbage collector overhead if the object is managed by the garbage

Modified: python/branches/release26-maint/Doc/tutorial/datastructures.rst
==============================================================================
--- python/branches/release26-maint/Doc/tutorial/datastructures.rst	(original)
+++ python/branches/release26-maint/Doc/tutorial/datastructures.rst	Sun Mar 21 20:34:26 2010
@@ -158,6 +158,11 @@
    >>> queue                           # Remaining queue in order of arrival
    deque(['Michael', 'Terry', 'Graham'])
 
+However, since lists are implemented as an array of elements, they are not the
+optimal data structure to use as a queue (the ``pop(0)`` needs to move all
+following elements).  See :ref:`tut-list-tools` for a look at
+:class:`collections.deque`, which is designed to work efficiently as a queue.
+
 
 .. _tut-functional:
 

Modified: python/branches/release26-maint/Doc/tutorial/introduction.rst
==============================================================================
--- python/branches/release26-maint/Doc/tutorial/introduction.rst	(original)
+++ python/branches/release26-maint/Doc/tutorial/introduction.rst	Sun Mar 21 20:34:26 2010
@@ -523,6 +523,12 @@
    >>> 3*a[:3] + ['Boo!']
    ['spam', 'eggs', 100, 'spam', 'eggs', 100, 'spam', 'eggs', 100, 'Boo!']
 
+All slice operations return a new list containing the requested elements.  This
+means that the following slice returns a shallow copy of the list *a*::
+
+   >>> a[:]
+   ['spam', 'eggs', 100, 1234]
+
 Unlike strings, which are *immutable*, it is possible to change individual
 elements of a list::
 

Modified: python/branches/release26-maint/Doc/whatsnew/2.2.rst
==============================================================================
--- python/branches/release26-maint/Doc/whatsnew/2.2.rst	(original)
+++ python/branches/release26-maint/Doc/whatsnew/2.2.rst	Sun Mar 21 20:34:26 2010
@@ -30,7 +30,7 @@
 to the PEP for a particular new feature.
 
 
-.. seealso (now defunct)
+.. see also, now defunct
 
    http://www.unixreview.com/documents/s=1356/urm0109h/0109h.htm
       "What's So Special About Python 2.2?" is also about the new 2.2 features, and

Modified: python/branches/release26-maint/Misc/Porting
==============================================================================
--- python/branches/release26-maint/Misc/Porting	(original)
+++ python/branches/release26-maint/Misc/Porting	Sun Mar 21 20:34:26 2010
@@ -31,7 +31,7 @@
 it out of the config.c file.
 
 Bang on it until you get a >>> prompt.  (You may have to disable the
-importing of "site.py" by passing the -S options.)
+importing of "site.py" by passing the -S option.)
 
 Then bang on it until it executes very simple Python statements.
 


More information about the Python-checkins mailing list