Skip to content

Commit

Permalink
Merged revisions 59605-59624 via svnmerge from
Browse files Browse the repository at this point in the history
svn+ssh://[email protected]/python/trunk

........
  r59606 | georg.brandl | 2007-12-29 11:57:00 +0100 (Sat, 29 Dec 2007) | 2 lines

  Some cleanup in the docs.
........
  r59611 | martin.v.loewis | 2007-12-29 19:49:21 +0100 (Sat, 29 Dec 2007) | 2 lines

  Bug python#1699: Define _BSD_SOURCE only on OpenBSD.
........
  r59612 | raymond.hettinger | 2007-12-29 23:09:34 +0100 (Sat, 29 Dec 2007) | 1 line

  Simpler documentation for itertools.tee().  Should be backported.
........
  r59613 | raymond.hettinger | 2007-12-29 23:16:24 +0100 (Sat, 29 Dec 2007) | 1 line

  Improve docs for itertools.groupby().  The use of xrange(0) to create a unique object is less obvious than object().
........
  r59620 | christian.heimes | 2007-12-31 15:47:07 +0100 (Mon, 31 Dec 2007) | 3 lines

  Added wininst-9.0.exe executable for VS 2008
  Integrated bdist_wininst into PCBuild9 directory
........
  r59621 | christian.heimes | 2007-12-31 15:51:18 +0100 (Mon, 31 Dec 2007) | 1 line

  Moved PCbuild directory to PC/VS7.1
........
  r59622 | christian.heimes | 2007-12-31 15:59:26 +0100 (Mon, 31 Dec 2007) | 1 line

  Fix paths for build bot
........
  r59623 | christian.heimes | 2007-12-31 16:02:41 +0100 (Mon, 31 Dec 2007) | 1 line

  Fix paths for build bot, part 2
........
  r59624 | christian.heimes | 2007-12-31 16:18:55 +0100 (Mon, 31 Dec 2007) | 1 line

  Renamed PCBuild9 directory to PCBuild
........
  • Loading branch information
tiran committed Dec 31, 2007
1 parent 862543a commit 5b5e81c
Show file tree
Hide file tree
Showing 241 changed files with 18,915 additions and 18,878 deletions.
1 change: 0 additions & 1 deletion .hgsvnexternals
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[Tools]
2to3 http://svn.python.org/projects/sandbox/trunk/2to3/

11 changes: 8 additions & 3 deletions Doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \

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"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " changes to make an overview over all changed/added/deprecated items"

checkout:
@if [ ! -d tools/sphinx ]; then \
Expand Down Expand Up @@ -66,6 +67,10 @@ latex: build
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
"run these through (pdf)latex."

changes: BUILDER = changes
changes: build
@echo "The overview file is in build/changes."

clean:
-rm -rf build/*
-rm -rf tools/sphinx
4 changes: 4 additions & 0 deletions Doc/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ Available make targets are:
* "latex", which builds LaTeX source files that can be run with "pdflatex"
to produce PDF documents.

* "changes", which builds an overview over all versionadded/versionchanged/
deprecated items in the current version. This is meant as a help for the
writer of the "What's New" document.

A "make update" updates the Subversion checkouts in `tools/`.


Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ The error indicator consists of three Python objects corresponding to the result
of ``sys.exc_info()``. API functions exist to interact with the error indicator
in various ways. There is a separate error indicator for each thread.

.. % XXX Order of these should be more thoughtful.
.. % Either alphabetical or some kind of structure.
.. XXX Order of these should be more thoughtful.
Either alphabetical or some kind of structure.
.. cfunction:: void PyErr_Print()
Expand Down
6 changes: 3 additions & 3 deletions Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ Initialization, Finalization, and Threads
as the list ``sys.path``, which may be modified to change the future search path
for loaded modules.

.. % XXX should give the exact rules
.. XXX should give the exact rules
.. cfunction:: const char* Py_GetVersion()
Expand Down Expand Up @@ -357,8 +357,8 @@ Initialization, Finalization, and Threads
to initialize ``sys.argv``, a fatal condition is signalled using
:cfunc:`Py_FatalError`.

.. % XXX impl. doesn't seem consistent in allowing 0/NULL for the params;
.. % check w/ Guido.
.. XXX impl. doesn't seem consistent in allowing 0/NULL for the params;
check w/ Guido.
.. _threads:
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ Here is the corresponding C code, in all its glory::
single: PyErr_Clear()
single: Py_XDECREF()

This example represents an endorsed use of the :keyword:`goto` statement in C!
This example represents an endorsed use of the ``goto`` statement in C!
It illustrates the use of :cfunc:`PyErr_ExceptionMatches` and
:cfunc:`PyErr_Clear` to handle specific exceptions, and the use of
:cfunc:`Py_XDECREF` to dispose of owned references that may be *NULL* (note the
Expand Down
13 changes: 6 additions & 7 deletions Doc/c-api/newtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ type objects) *must* have the :attr:`ob_size` field.
declare the instance struct) and this in turn includes the :attr:`_ob_prev` and
:attr:`_ob_next` fields if they are present. This means that the only correct
way to get an initializer for the :attr:`tp_basicsize` is to use the
:keyword:`sizeof` operator on the struct used to declare the instance layout.
``sizeof`` operator on the struct used to declare the instance layout.
The basic size does not include the GC header size (this is new in Python 2.2;
in 2.1 and 2.0, the GC header size was included in :attr:`tp_basicsize`).

Expand Down Expand Up @@ -1145,7 +1145,7 @@ The next fields, up to and including :attr:`tp_weaklist`, only exist if the

PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);

XXX more
XXX explain.

This field is inherited by subtypes.

Expand All @@ -1160,7 +1160,7 @@ The next fields, up to and including :attr:`tp_weaklist`, only exist if the

This field is inherited by subtypes.

XXX more
XXX explain.


.. cmember:: long PyTypeObject.tp_dictoffset
Expand Down Expand Up @@ -1683,10 +1683,9 @@ member in the :ctype:`PyTypeObject` structure should be *NULL*. Otherwise, the
and :exc:`SystemError` should be raised when *segment* specifies a segment that
doesn't exist.

.. % Why doesn't it raise ValueError for this one?
.. % GJS: because you shouldn't be calling it with an invalid
.. % segment. That indicates a blatant programming error in the C
.. % code.
.. Why doesn't it raise ValueError for this one?
GJS: because you shouldn't be calling it with an invalid
segment. That indicates a blatant programming error in the C code.
.. ctype:: Py_ssize_t (*segcountproc) (PyObject *self, Py_ssize_t *lenp)
Expand Down
2 changes: 1 addition & 1 deletion Doc/distutils/setupscript.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ the Distutils to go out and find the right files; you have to specify the
extension name, source file(s), and any compile/link requirements (include
directories, libraries to link with, etc.).

.. % XXX read over this section
.. XXX read over this section
All of this is done through another keyword argument to :func:`setup`, the
:option:`ext_modules` option. :option:`ext_modules` is just a list of
Expand Down
30 changes: 20 additions & 10 deletions Doc/documenting/fromlatex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,35 @@ These changes to information units should be noted:

Description.

* **New information unit**
* **New information units**

There is a new generic information unit called "describe" which can be used
to document things that are not covered by the other units::
There are new generic information units: One is called "describe" and can be
used to document things that are not covered by the other units::

.. describe:: a == b

The equals operator.

The others are::

.. cmdoption:: -O

Describes a command-line option.

.. envvar:: PYTHONINSPECT

Describes an environment variable.


Structure
---------

The LaTeX docs were split in several toplevel manuals. Now, all files
are part of the same documentation tree, as indicated by the *toctree*
directives in the sources. Every *toctree* directive embeds other files
as subdocuments of the current file (this structure is not necessarily
mirrored in the filesystem layout). The toplevel file is
:file:`contents.rst`.
The LaTeX docs were split in several toplevel manuals. Now, all files are part
of the same documentation tree, as indicated by the *toctree* directives in the
sources (though individual output formats may choose to split them up into parts
again). Every *toctree* directive embeds other files as subdocuments of the
current file (this structure is not necessarily mirrored in the filesystem
layout). The toplevel file is :file:`contents.rst`.

However, most of the old directory structure has been kept, with the
directories renamed as follows:
Expand All @@ -184,7 +194,7 @@ directories renamed as follows:
* :file:`inst` -> :file:`installing`
* :file:`lib` -> :file:`library`
* :file:`mac` -> merged into :file:`library`, with :file:`mac/using.tex`
moved to :file:`howto/pythonmac.rst`
moved to :file:`using/mac.rst`
* :file:`ref` -> :file:`reference`
* :file:`tut` -> :file:`tutorial`, with the single TeX file split up

Expand Down
2 changes: 1 addition & 1 deletion Doc/documenting/markup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ in a different style:

.. describe:: keyword

The name of a keyword in a programming language.
The name of a keyword in Python.

.. describe:: mailheader

Expand Down
26 changes: 21 additions & 5 deletions Doc/documenting/sphinx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,30 @@ unused_files : list of strings
could be docs for temporarily disabled modules or documentation that's not
yet ready for public consumption.

last_updated_format : string
add_function_parentheses : bool
If true, ``()`` will be appended to the content of ``:func:``, ``:meth:`` and
``:cfunc:`` cross-references.

add_module_names : bool
If true, the current module name will be prepended to all description unit
titles (such as ``.. function::``).

Builder-specific variables
^^^^^^^^^^^^^^^^^^^^^^^^^^

html_download_base_url : string
The base URL for download links on the download page.

html_last_updated_fmt : string
If this is not an empty string, it will be given to ``time.strftime()`` and
written to each generated output file after "last updated on:".

use_smartypants : bool
html_use_smartypants : bool
If true, use SmartyPants to convert quotes and dashes to the typographically
correct entities.

add_function_parentheses : bool
If true, ``()`` will be appended to the content of ``:func:``, ``:meth:`` and
``:cfunc:`` cross-references.
latex_paper_size : "letter" or "a4"
The paper size option for the LaTeX document class.

latex_font_size : "10pt", "11pt" or "12pt"
The font size option for the LaTeX document class.
17 changes: 3 additions & 14 deletions Doc/extending/embedding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,7 @@ then the result should be::

Although the program is quite large for its functionality, most of the code is
for data conversion between Python and C, and for error reporting. The
interesting part with respect to embedding Python starts with

.. % $
::
interesting part with respect to embedding Python starts with ::

Py_Initialize();
pName = PyString_FromString(argv[1]);
Expand Down Expand Up @@ -239,15 +235,8 @@ With these extensions, the Python script can do things like ::
In a real application, the methods will expose an API of the application to
Python.

.. % \section{For the future}
.. %
.. % You don't happen to have a nice library to get textual
.. % equivalents of numeric values do you :-) ?
.. % Callbacks here ? (I may be using information from that section
.. % ?!)
.. % threads
.. % code examples do not really behave well if errors happen
.. % (what to watch out for)
.. TODO: threads, code examples do not really behave well if errors happen
(what to watch out for)
.. _embeddingincplusplus:
Expand Down
29 changes: 12 additions & 17 deletions Doc/extending/extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function.
The method table must be passed to the interpreter in the module's
initialization function. The initialization function must be named
:cfunc:`initname`, where *name* is the name of the module, and should be the
only non-\ :keyword:`static` item defined in the module file::
only non-\ ``static`` item defined in the module file::

PyMODINIT_FUNC
initspam(void)
Expand Down Expand Up @@ -660,11 +660,7 @@ it returns false and raises an appropriate exception.
.. index:: single: Philbrick, Geoff

Here is an example module which uses keywords, based on an example by Geoff
Philbrick ([email protected]):

.. %
::
Philbrick ([email protected])::

#include "Python.h"

Expand Down Expand Up @@ -762,8 +758,8 @@ Reference Counts

In languages like C or C++, the programmer is responsible for dynamic allocation
and deallocation of memory on the heap. In C, this is done using the functions
:cfunc:`malloc` and :cfunc:`free`. In C++, the operators :keyword:`new` and
:keyword:`delete` are used with essentially the same meaning and we'll restrict
:cfunc:`malloc` and :cfunc:`free`. In C++, the operators ``new`` and
``delete`` are used with essentially the same meaning and we'll restrict
the following discussion to the C case.

Every block of memory allocated with :cfunc:`malloc` should eventually be
Expand Down Expand Up @@ -1036,11 +1032,10 @@ that it is always a tuple. [#]_

It is a severe error to ever let a *NULL* pointer "escape" to the Python user.

.. % Frank Stajano:
.. % A pedagogically buggy example, along the lines of the previous listing,
.. % would be helpful here -- showing in more concrete terms what sort of
.. % actions could cause the problem. I can't very well imagine it from the
.. % description.
.. Frank Stajano:
A pedagogically buggy example, along the lines of the previous listing, would
be helpful here -- showing in more concrete terms what sort of actions could
cause the problem. I can't very well imagine it from the description.
.. _cplusplus:
Expand Down Expand Up @@ -1076,7 +1071,7 @@ lists, this new collection type should have a set of C functions for direct
manipulation from other extension modules.

At first sight this seems easy: just write the functions (without declaring them
:keyword:`static`, of course), provide an appropriate header file, and document
``static``, of course), provide an appropriate header file, and document
the C API. And in fact this would work if all extension modules were always
linked statically with the Python interpreter. When modules are used as shared
libraries, however, the symbols defined in one module may not be visible to
Expand All @@ -1089,7 +1084,7 @@ the module whose functions one wishes to call might not have been loaded yet!

Portability therefore requires not to make any assumptions about symbol
visibility. This means that all symbols in extension modules should be declared
:keyword:`static`, except for the module's initialization function, in order to
``static``, except for the module's initialization function, in order to
avoid name clashes with other extension modules (as discussed in section
:ref:`methodtable`). And it means that symbols that *should* be accessible from
other extension modules must be exported in a different way.
Expand Down Expand Up @@ -1124,7 +1119,7 @@ reality (such as adding "spam" to every command). This function
:cfunc:`PySpam_System` is also exported to other extension modules.

The function :cfunc:`PySpam_System` is a plain C function, declared
:keyword:`static` like everything else::
``static`` like everything else::

static int
PySpam_System(const char *command)
Expand Down Expand Up @@ -1180,7 +1175,7 @@ function must take care of initializing the C API pointer array::
PyModule_AddObject(m, "_C_API", c_api_object);
}

Note that ``PySpam_API`` is declared :keyword:`static`; otherwise the pointer
Note that ``PySpam_API`` is declared ``static``; otherwise the pointer
array would disappear when :func:`initspam` terminates!

The bulk of the work is in the header file :file:`spammodule.h`, which looks
Expand Down
18 changes: 8 additions & 10 deletions Doc/extending/newtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1196,16 +1196,14 @@ class object, and get the doc string using its :attr:`__doc__` attribute.
As with the :attr:`tp_methods` table, a sentinel entry with a :attr:`name` value
of *NULL* is required.

.. % XXX Descriptors need to be explained in more detail somewhere, but
.. % not here.
.. %
.. % Descriptor objects have two handler functions which correspond to
.. % the \member{tp_getattro} and \member{tp_setattro} handlers. The
.. % \method{__get__()} handler is a function which is passed the
.. % descriptor, instance, and type objects, and returns the value of the
.. % attribute, or it returns \NULL{} and sets an exception. The
.. % \method{__set__()} handler is passed the descriptor, instance, type,
.. % and new value;
.. XXX Descriptors need to be explained in more detail somewhere, but not here.
Descriptor objects have two handler functions which correspond to the
\member{tp_getattro} and \member{tp_setattro} handlers. The
\method{__get__()} handler is a function which is passed the descriptor,
instance, and type objects, and returns the value of the attribute, or it
returns \NULL{} and sets an exception. The \method{__set__()} handler is
passed the descriptor, instance, type, and new value;
Type-specific Attribute Management
Expand Down
2 changes: 0 additions & 2 deletions Doc/extending/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
Building C and C++ Extensions on Windows
****************************************

.. %
This chapter briefly explains how to create a Windows extension module for
Python using Microsoft Visual C++, and follows with more detailed background
information on how it works. The explanatory material is useful for both the
Expand Down
Loading

0 comments on commit 5b5e81c

Please sign in to comment.