Merged revisions 59512-59540 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r59513 | raymond.hettinger | 2007-12-15 01:07:25 +0100 (Sat, 15 Dec 2007) | 6 lines

  Optimize PyList_AsTuple(). Improve cache performance by doing the
  pointer copy and object increment in one pass.  For small lists,
  save the overhead of the call to memcpy() -- this comes up in
  calls like f(*listcomp).
........
  r59519 | christian.heimes | 2007-12-15 06:38:35 +0100 (Sat, 15 Dec 2007) | 2 lines

  Fixed #1624: Remove output comparison for test_pep277
  I had to modify Brett's patch slightly.
........
  r59520 | georg.brandl | 2007-12-15 10:34:59 +0100 (Sat, 15 Dec 2007) | 2 lines

  Add note about future import needed for with statement.
........
  r59522 | georg.brandl | 2007-12-15 10:36:37 +0100 (Sat, 15 Dec 2007) | 2 lines

  Argh, wrong version.
........
  r59524 | georg.brandl | 2007-12-16 12:06:09 +0100 (Sun, 16 Dec 2007) | 2 lines

  Dummy commit to investigate #1617.
........
  r59525 | georg.brandl | 2007-12-16 12:21:48 +0100 (Sun, 16 Dec 2007) | 2 lines

  Revert dummy commit now that the build slave is building.
........
  r59527 | georg.brandl | 2007-12-16 16:47:46 +0100 (Sun, 16 Dec 2007) | 2 lines

  Remove orphaned footnote reference.
........
  r59528 | georg.brandl | 2007-12-16 16:53:49 +0100 (Sun, 16 Dec 2007) | 2 lines

  Remove gratuitous unicode character.
........
  r59529 | georg.brandl | 2007-12-16 16:59:19 +0100 (Sun, 16 Dec 2007) | 2 lines

  Remove another unnecessary Unicode character.
........
  r59530 | georg.brandl | 2007-12-16 17:00:36 +0100 (Sun, 16 Dec 2007) | 2 lines

  Remove curious space-like characters.
........
  r59532 | georg.brandl | 2007-12-16 20:36:51 +0100 (Sun, 16 Dec 2007) | 2 lines

  Adapt conf.py to new option names.
........
  r59533 | christian.heimes | 2007-12-16 22:39:43 +0100 (Sun, 16 Dec 2007) | 1 line

  Fixed #1638: %zd configure test fails on Linux
........
  r59536 | georg.brandl | 2007-12-17 00:11:16 +0100 (Mon, 17 Dec 2007) | 2 lines

  Simplify.
........
  r59537 | georg.brandl | 2007-12-17 00:13:29 +0100 (Mon, 17 Dec 2007) | 2 lines

  Use PEP 8.
........
  r59539 | georg.brandl | 2007-12-17 00:15:07 +0100 (Mon, 17 Dec 2007) | 2 lines

  Don't use quotes for non-string code.
........
  r59540 | facundo.batista | 2007-12-17 15:18:42 +0100 (Mon, 17 Dec 2007) | 4 lines


  Removed the private _rounding_decision: it was not needed, and the code
  is now simpler.  Thanks Mark Dickinson.
........
diff --git a/Doc/Makefile b/Doc/Makefile
index 84a297a..22f852b 100644
--- a/Doc/Makefile
+++ b/Doc/Makefile
@@ -7,16 +7,19 @@
 PYTHON       = python2.5
 SVNROOT      = http://svn.python.org/projects
 SPHINXOPTS   =
+PAPER        =
 
-ALLSPHINXOPTS = -b$(BUILDER) -dbuild/doctrees $(SPHINXOPTS) . build/$(BUILDER)
+ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \
+                $(SPHINXOPTS) . build/$(BUILDER)
 
 .PHONY: help checkout update build html web htmlhelp clean
 
 help:
 	@echo "Please use \`make <target>' where <target> is one of"
-	@echo "  html  to make standalone HTML files"
-	@echo "  web   to make file usable by Sphinx.web"
+	@echo "  html   to make standalone HTML files"
+	@echo "  web    to make file usable by Sphinx.web"
 	@echo "  htmlhelp to make HTML files and a HTML help project"
+	@echo "  latex  to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
 
 checkout:
 	@if [ ! -d tools/sphinx ]; then \
@@ -60,6 +63,8 @@
 latex: BUILDER = latex
 latex: build
 	@echo "Build finished; the LaTeX files are in build/latex."
+	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
+	      "run these through (pdf)latex."
 
 clean:
 	-rm -rf build/*
diff --git a/Doc/conf.py b/Doc/conf.py
index 6736f53..29137e2 100644
--- a/Doc/conf.py
+++ b/Doc/conf.py
@@ -4,7 +4,9 @@
 #
 # The contents of this file are pickled, so don't put values in the namespace
 # that aren't pickleable (module imports are okay, they're removed automatically).
-#
+
+# General configuration
+# ---------------------
 
 # The default replacements for |version| and |release|.
 # If 'auto', Sphinx looks for the Include/patchlevel.h file in the current Python
@@ -23,9 +25,6 @@
 # Else, today_fmt is used as the format for a strftime call.
 today_fmt = '%B %d, %Y'
 
-# The base URL for download links.
-download_base_url = 'http://docs.python.org/ftp/python/doc/'
-
 # List of files that shouldn't be included in the build.
 unused_files = [
     'whatsnew/2.0.rst',
@@ -40,17 +39,34 @@
     'library/xml.etree.rst',
 ]
 
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-last_updated_format = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-use_smartypants = True
-
 # If true, '()' will be appended to :func: etc. cross-reference text.
 add_function_parentheses = True
 
 # If true, the current module name will be prepended to all description
 # unit titles (such as .. function::).
 add_module_names = True
+
+
+# Options for HTML output
+# -----------------------
+
+# The base URL for download links.
+html_download_base_url = 'http://docs.python.org/ftp/python/doc/'
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+html_use_smartypants = True
+
+
+# Options for LaTeX output
+# ------------------------
+
+# The paper size ("letter" or "a4").
+latex_paper_size = "a4"
+
+# The font size ("10pt", "11pt" or "12pt").
+latex_font_size = "10pt"
diff --git a/Doc/library/objects.rst b/Doc/library/objects.rst
index a0e66d1..1b75161 100644
--- a/Doc/library/objects.rst
+++ b/Doc/library/objects.rst
@@ -16,7 +16,7 @@
 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. [#]_
+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
diff --git a/Doc/library/othergui.rst b/Doc/library/othergui.rst
index 91b59e0..5a84285 100644
--- a/Doc/library/othergui.rst
+++ b/Doc/library/othergui.rst
@@ -63,14 +63,14 @@
    `wxPython <http://www.wxpython.org>`_
       wxPython is a cross-platform GUI toolkit for Python that is built around
       the popular `wxWidgets <http://www.wxwidgets.org/>`_ (formerly wxWindows)
-      C++ toolkit.  It provides a native look and feel for applications on
+      C++ toolkit.  It provides a native look and feel for applications on
       Windows, Mac OS X, and Unix systems by using each platform's native
-      widgets where ever possible, (GTK+ on Unix-like systems).  In addition to
+      widgets where ever possible, (GTK+ on Unix-like systems).  In addition to
       an extensive set of widgets, wxPython provides classes for online
       documentation and context sensitive help, printing, HTML viewing,
       low-level device context drawing, drag and drop, system clipboard access,
       an XML-based resource format and more, including an ever growing library
-      of user-contributed modules.  wxPython has a book, `wxPython in Action
+      of user-contributed modules.  wxPython has a book, `wxPython in Action
       <http://www.amazon.com/exec/obidos/ASIN/1932394621>`_, by Noel Rappin and
       Robin Dunn.
 
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 6822e7e..6dd374f 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -608,7 +608,7 @@
 
 (5)
    The slice of *s* from *i* to *j* with step *k* is defined as the sequence of
-   items with index  ``x = i + n*k`` such that 0 ≤n < (j-i)/(k).  In other words,
+   items with index  ``x = i + n*k`` such that ``0 <= n < (j-i)/k``.  In other words,
    the indices are ``i``, ``i+k``, ``i+2*k``, ``i+3*k`` and so on, stopping when
    *j* is reached (but never including *j*).  If *i* or *j* is greater than
    ``len(s)``, use ``len(s)``.  If *i* or *j* are omitted or ``None``, they become
diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst
index b772c88..8ad3b61 100644
--- a/Doc/library/turtle.rst
+++ b/Doc/library/turtle.rst
@@ -285,5 +285,5 @@
 .. method:: Turtle.degrees([fullcircle])
 
    *fullcircle* is by default 360. This can cause the pen to have any angular units
-   whatever: give *fullcircle* 2\*$π for radians, or 400 for gradians.
+   whatever: give *fullcircle* ``2*pi`` for radians, or 400 for gradians.
 
diff --git a/Doc/using/windows.rst b/Doc/using/windows.rst
index 9a16938..035f405 100644
--- a/Doc/using/windows.rst
+++ b/Doc/using/windows.rst
@@ -276,9 +276,7 @@
 +--------------------+--------------+-----------------------+
 | Directory          | MSVC version | Visual Studio version |
 +====================+==============+=======================+
-| :file:`PC/VC6/`    | 5.0          | 97                    |
-|                    +--------------+-----------------------+
-|                    | 6.0          | 6.0                   |
+| :file:`PC/VC6/`    | 6.0          | 97                    |
 +--------------------+--------------+-----------------------+
 | :file:`PCbuild/`   | 7.1          | 2003                  |
 +--------------------+--------------+-----------------------+
diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst
index c63cc32..f21ff72 100644
--- a/Doc/whatsnew/2.6.rst
+++ b/Doc/whatsnew/2.6.rst
@@ -202,7 +202,7 @@
   methods.
 
 * The context manager's :meth:`__enter__` method is called.  The value returned
-  is assigned to *VAR*.  If no ``'as VAR'`` clause is present, the value is simply
+  is assigned to *VAR*.  If no ``as VAR`` clause is present, the value is simply
   discarded.
 
 * The code in *BLOCK* is executed.
@@ -242,11 +242,11 @@
 
    class DatabaseConnection:
        # Database interface
-       def cursor (self):
+       def cursor(self):
            "Returns a cursor object and starts a new transaction"
-       def commit (self):
+       def commit(self):
            "Commits current transaction"
-       def rollback (self):
+       def rollback(self):
            "Rolls back current transaction"
 
 The :meth:`__enter__` method is pretty easy, having only to start a new
@@ -256,7 +256,7 @@
 
    class DatabaseConnection:
        ...
-       def __enter__ (self):
+       def __enter__(self):
            # Code to start a new transaction
            cursor = self.cursor()
            return cursor
@@ -273,7 +273,7 @@
 
    class DatabaseConnection:
        ...
-       def __exit__ (self, type, value, tb):
+       def __exit__(self, type, value, tb):
            if tb is None:
                # No exception, so commit
                self.commit()
@@ -306,7 +306,7 @@
    from contextlib import contextmanager
 
    @contextmanager
-   def db_transaction (connection):
+   def db_transaction(connection):
        cursor = connection.cursor()
        try:
            yield cursor