Commit e15956b4 authored by Fred Drake's avatar Fred Drake

Merged changes from the 1.5.2p2 release.

parent 20082d92
......@@ -226,6 +226,19 @@ distribution, to create or maintain whole documents or sections.
macros. This section contains the reference material for these
facilities.
\subsection{Meta-information Markup \label{meta-info}}
\begin{macrodesc}{sectionauthor}{\p{author}\p{email}}
Identifies the author of the current section. \var{author}
should be the author's name such that it can be used for
presentation (though it isn't), and \var{email} should be the
author's email address. The domain name portion of
the address should be lower case.
No presentation is generated from this markup, but it is used to
help keep track of contributions.
\end{macrodesc}
\subsection{Information Units \label{info-units}}
XXX Explain terminology, or come up with something more ``lay.''
......@@ -412,7 +425,8 @@ distribution, to create or maintain whole documents or sections.
\begin{macrodesc}{email}{\p{address}}
An email address. Note that this is \emph{not} hyperlinked in
any of the possible output formats.
any of the possible output formats. The domain name portion of
the address should be lower case.
\end{macrodesc}
\begin{macrodesc}{emph}{\p{text}}
......@@ -689,8 +703,8 @@ distribution, to create or maintain whole documents or sections.
An additional table-like environment is \env{synopsistable}. The
table generated by this environment contains two columns, and each
row is defined by an alternate definition of
\macro{modulesynopsis}. This environment is not normally use by
the user, but is created by the \macro{localmoduletable} macro.
\macro{modulesynopsis}. This environment is not normally used by
authors, but is created by the \macro{localmoduletable} macro.
\subsection{Reference List Markup \label{references}}
......@@ -726,7 +740,7 @@ distribution, to create or maintain whole documents or sections.
\subsection{Index-generating Markup \label{indexing}}
Effective index generation for technical documents can be very
difficult, especially for someone familliar with the topic but not
difficult, especially for someone familiar with the topic but not
the creation of indexes. Much of the difficulty arises in the
area of terminology: including the terms an expert would use for a
concept is not sufficient. Coming up with the terms that a novice
......@@ -735,7 +749,7 @@ distribution, to create or maintain whole documents or sections.
The truly difficult aspects of index generation are not areas with
which the documentation tools can help. However, ease
of producing the index once content decisions are make is within
of producing the index once content decisions are made is within
the scope of the tools. Markup is provided which the processing
software is able to use to generate a variety of kinds of index
entry with minimal effort. Additionally, many of the environments
......
......@@ -53,7 +53,9 @@ mac: mac/mac.html
ref: ref/ref.html
tut: tut/tut.html
$(INDEXFILES): $(COMMONPERL) $(TOPDIR)/html/about.dat
$(INDEXFILES): $(COMMONPERL) \
$(TOPDIR)/html/about.dat \
$(TOPDIR)/tools/node2label.pl
# The index.html target is at the end since it screws up font-lock.
......
<html>
<head>
<title>Python 1.5.2 Documentation</title>
<title>Python @RELEASE@ Documentation - @DATE@</title>
<link rel=STYLESHEET href="lib/lib.css" type="text/css">
<style type="text/css">
a.title { font-weight: bold; font-size: 110%; }
......@@ -38,7 +38,7 @@
</p>
</div>
<table>
<table align="center">
<tbody>
<tr><td>
<ul>
......
......@@ -13,3 +13,4 @@
*.l2h
*.how
README
api.tex
......@@ -58,17 +58,20 @@ pdf: $(PDFFILES)
ps: $(PSFILES)
README: $(PSFILES)
README: $(PSFILES) $(TOOLSDIR)/getpagecounts
$(TOOLSDIR)/getpagecounts >$@
# Python/C API Reference Manual
api.dvi: $(APIFILES)
api.dvi: api.tex $(APIFILES)
$(MKDVI) api
api.pdf: $(APIFILES)
api.pdf: api.tex $(APIFILES)
$(MKPDF) api
api.tex: ../api/api.tex ../api/refcounts.dat ../tools/anno-api.py
$(PYTHON) ../tools/anno-api.py -o $@ ../api/api.tex
# Documenting Python
doc.dvi: $(DOCFILES)
$(MKHOWTO) --dvi ../doc/doc.tex
......@@ -113,7 +116,7 @@ tut.pdf: $(TUTFILES)
clean:
rm -f *~ *.aux *.idx *.ilg *.ind *.log *.toc *.bkm *.syn *.pla
rm -f *~ *.aux *.idx *.ilg *.ind *.log *.toc *.bkm *.syn *.pla api.tex
clobber: clean
rm -f $(DVIFILES) $(PSFILES) $(PDFFILES)
......
......@@ -38,14 +38,14 @@ sub show{
sub tohtml{
my $self = shift;
my $data = "<table class=\"synopsistable\">\n";
my $data = "<table class='synopsistable'>\n";
my $name;
foreach $name (split /,/, $self->{names}) {
my($key,$type,$synopsis) = $self->get($name);
my $link = "<a href=\"module-$key.html\">";
$data .= (" <tr>"
. "<td><b><tt class=module>$link$name</a></tt></b></td>\n"
. " <td class=synopsis>$synopsis</td></tr>\n");
my $link = "<a href='module-$key.html'>";
$data .= (' <tr>'
. "<td><b><tt class='module'>$link$name</a></tt></b></td>\n"
. " <td class='synopsis'>$synopsis</td></tr>\n");
}
$data .= "</table>\n";
$data;
......
......@@ -16,6 +16,7 @@ package main;
$HTML_VERSION = 4.0;
$MAX_LINK_DEPTH = 2;
$MAX_SPLIT_DEPTH = 5; # split at subsections but not sub-subsections
$ADDRESS = '';
$NO_FOOTNODE = 1;
......@@ -143,22 +144,22 @@ sub adjust_icon_information{
$BLANK_ICON =~ s/alt="blank"/alt=""/;
$NAV_BGCOLOR = " bgcolor=\"#99CCFF\"";
}
adjust_icon_information();
sub make_nav_sectref{
my($label,$title) = @_;
if ($title) {
$title =~ s/<A/<A class=sectref/;
return ("<b class=navlabel>$label:</b> "
. "$title\n");
return ("<b class='navlabel'>$label:</b> "
. "<span class='sectref'>$title</span>\n");
}
return '';
}
sub make_nav_panel{
my $s;
$s = "<table align=center width=\"100%\" cellpadding=0 cellspacing=2>"
$s = "<table align='center' width='100%' cellpadding='0' cellspacing='2'>"
. "\n<tr>"
. "\n<td>$NEXT</td>"
. "\n<td>$UP</td>"
......@@ -184,13 +185,13 @@ sub make_nav_panel{
}
sub top_navigation_panel {
"<div class=navigation>\n"
"<div class='navigation'>\n"
. make_nav_panel()
. '<br><hr></div>';
}
sub bot_navigation_panel {
"<p>\n<div class=navigation><hr>"
"<p>\n<div class='navigation'><hr>"
. make_nav_panel()
. '</div>';
}
......@@ -334,13 +335,11 @@ sub add_module_idx{
my $plat = '';
$key =~ s/<tt>([a-zA-Z0-9._]*)<\/tt>/\1/;
if ($ModulePlatforms{$key} && !$allthesame) {
$plat = (" <em>(<span class=platform>$ModulePlatforms{$key}"
$plat = (" <em>(<span class='platform'>$ModulePlatforms{$key}"
. '</span>)</em>');
}
print MODIDXFILE
$moditem
. $IDXFILE_FIELD_SEP
. "<tt class=module>$key</tt>$plat###\n";
print MODIDXFILE $moditem . $IDXFILE_FIELD_SEP
. "<tt class='module'>$key</tt>$plat###\n";
}
close(MODIDXFILE);
if (!$allthesame) {
......@@ -556,9 +555,55 @@ sub protect_useritems {
#
# Note that this *must* be done in the init file, not the python.perl
# style support file. The %declarations must be set before initialize()
# is called in the main script.
# is called in the main LaTeX2HTML script (which happens before style files
# are loaded).
#
%declarations = ('preform' => '<dl><dd><pre class=verbatim></pre></dl>',
%declarations = ('preform' => '<dl><dd><pre class="verbatim"></pre></dl>',
%declarations);
# This is added to get rid of the long comment that follows the doctype
# declaration; MSIE5 on NT4 SP4 barfs on it and drops the content of the
# page.
sub make_head_and_body {
local($title,$body) = @_;
local($DTDcomment) = '';
local($version,$isolanguage) = ($HTML_VERSION, 'EN');
local(%isolanguages) = ( 'english', 'EN' , 'USenglish', 'EN.US'
, 'original', 'EN' , 'german' , 'DE'
, 'austrian', 'DE.AT', 'french' , 'FR'
, 'spanish', 'ES'
, %isolanguages );
$isolanguage = $isolanguages{$default_language};
$isolanguage = 'EN' unless $isolanguage;
$title = &purify($title,1);
eval("\$title = ". $default_title ) unless ($title);
# allow user-modification of the <TITLE> tag; thanks Dan Young
if (defined &custom_TITLE_hook) {
$title = &custom_TITLE_hook($title, $toc_sec_title);
}
if ($DOCTYPE =~ /\/\/[\w\.]+\s*$/) { # language spec included
$DTDcomment = "<!DOCTYPE html PUBLIC \"$DOCTYPE\">\n";
} else {
$DTDcomment = "<!DOCTYPE html PUBLIC \"$DOCTYPE//"
. ($ISO_LANGUAGE ? $ISO_LANGUAGE : $isolanguage) . "\">\n";
}
$STYLESHEET = $FILE.".css" unless $STYLESHEET;
if (!$charset && $CHARSET) { $charset = $CHARSET; $charset =~ s/_/\-/go; }
join('', ($DOCTYPE ? $DTDcomment : '' )
,"<html>\n<head>\n<title>", $title, "</title>\n"
, &meta_information($title)
, ($CHARSET && $HTML_VERSION ge "2.1" ?
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$charset\">\n"
: "" )
, ($BASE ? "<base href=\"$BASE\">\n" : "" )
, "<link rel=\"STYLESHEET\" href=\"$STYLESHEET\">"
, $more_links_mark
, "\n</head>\n<body $body>\n");
}
1; # This must be the last line
......@@ -15,13 +15,13 @@ sub ltx_next_argument{
sub do_cmd_macro{
local($_) = @_;
my $macro = ltx_next_argument();
return "<tt class=macro>&#92;$macro</tt>" . $_;
return "<tt class='macro'>&#92;$macro</tt>" . $_;
}
sub do_cmd_env{
local($_) = @_;
my $env = ltx_next_argument();
return "<tt class=environment>&#92;$env</tt>" . $_;
return "<tt class='environment'>&#92;$env</tt>" . $_;
}
sub ltx_process_params{
......@@ -43,8 +43,8 @@ sub do_env_macrodesc{
local($_) = @_;
my $macro = ltx_next_argument();
my $params = ltx_process_params(ltx_next_argument());
return "\n<dl class=macrodesc>"
. "\n<dt><b><tt class=macro>&#92;$macro</tt></b>"
return "\n<dl class='macrodesc'>"
. "\n<dt><b><tt class='macro'>&#92;$macro</tt></b>"
. "\n $params"
. "\n<dd>"
. $_
......@@ -55,9 +55,10 @@ sub do_env_envdesc{
local($_) = @_;
my $env = ltx_next_argument();
my $params = ltx_process_params(ltx_next_argument());
return "\n<dl class=envdesc>"
. "\n<dt><tt>&#92;begin{<b class=environment>$env</b>}</tt>"
return "\n<dl class='envdesc'>"
. "\n<dt><tt>&#92;begin{<b class='environment'>$env</b>}</tt>"
. "\n $params"
. "\n<br /><tt>&#92;end{<b class='environment'>$env</b>}</tt>"
. "\n<dd>"
. $_
. "</dl>";
......
This diff is collapsed.
......@@ -148,7 +148,7 @@ text editors on non-UNIX platforms, it is unwise to use a mixture of
spaces and tabs for the indentation in a single source file.
A formfeed character may be present at the start of the line; it will
be ignored for the indentation calculations above. A formfeed
be ignored for the indentation calculations above. Formfeed
characters occurring elsewhere in the leading whitespace have an
undefined effect (for instance, they may reset the space count to
zero).
......@@ -369,7 +369,9 @@ characters: a backslash and a double quote; \code{r"\e"} is not a value
string literal (even a raw string cannot end in an odd number of
backslashes). Specifically, \emph{a raw string cannot end in a single
backslash} (since the backslash would escape the following quote
character).
character). Note also that a single backslash followed by a newline
is interpreted as those two characters as part of the string,
\emph{not} as a line continuation.
\subsection{String literal concatenation\label{string-catenation}}
......@@ -464,7 +466,9 @@ exponent: ("e"|"E") ["+"|"-"] digit+
\end{verbatim}
Note that the integer part of a floating point number cannot look like
an octal integer.
an octal integer, though the exponent may look like an octal literal
but will always be interpreted using radix 10. For example,
\samp{1e010} is legal, while \samp{07.1} is a syntax error.
The allowed range of floating point literals is
implementation-dependent.
Some examples of floating point literals:
......@@ -485,7 +489,7 @@ Imaginary literals are described by the following lexical definitions:
imagnumber: (floatnumber | intpart) ("j"|"J")
\end{verbatim}
An imaginary literals yields a complex number with a real part of
An imaginary literal yields a complex number with a real part of
0.0. Complex numbers are represented as a pair of floating point
numbers and have the same restrictions on their range. To create a
complex number with a nonzero real part, add a floating point number
......@@ -522,7 +526,7 @@ The following tokens serve as delimiters in the grammar:
\end{verbatim}
The period can also occur in floating-point and imaginary literals. A
sequence of three periods has a special meaning as ellipses in slices.
sequence of three periods has a special meaning as an ellipsis in slices.
The following printing ASCII characters have special meaning as part
of other tokens or are otherwise significant to the lexical analyzer:
......
......@@ -144,7 +144,6 @@ arithmetic operators and arithmetic built-in functions. Numeric
objects are immutable; once created their value never changes. Python
numbers are of course strongly related to mathematical numbers, but
subject to the limitations of numerical representation in computers.
\obindex{number}
\obindex{numeric}
Python distinguishes between integers and floating point numbers:
......@@ -162,7 +161,7 @@ There are two types of integers:
These represent numbers in the range -2147483648 through 2147483647.
(The range may be larger on machines with a larger natural word
size, but not smaller.)
When the result of an operation falls outside this range, the
When the result of an operation would fall outside this range, the
exception \exception{OverflowError} is raised.
For the purpose of shift and mask operations, integers are assumed to
have a binary, 2's complement notation using 32 or more bits, and
......@@ -221,7 +220,7 @@ number of items of a sequence.
When the lenth of a sequence is \var{n}, the
index set contains the numbers 0, 1, \ldots, \var{n}-1. Item
\var{i} of sequence \var{a} is selected by \code{\var{a}[\var{i}]}.
\obindex{seqence}
\obindex{sequence}
\index{index operation}
\index{item selection}
\index{subscription}
......@@ -618,7 +617,7 @@ instance dictionary directly.
Class instances can pretend to be numbers, sequences, or mappings if
they have methods with certain special names. See
section \ref{specialnames}, ``Special method names.''
\obindex{number}
\obindex{numeric}
\obindex{sequence}
\obindex{mapping}
......@@ -702,15 +701,14 @@ a number of flags for the interpreter.
\ttindex{co_stacksize}
\ttindex{co_varnames}}
The following flag bits are defined for \member{co_flags}: bit 2 is set
if the function uses the \samp{*arguments} syntax to accept an
arbitrary number of positional arguments; bit 3 is set if the function
uses the \samp{**keywords} syntax to accept arbitrary keyword
arguments; other bits are used internally or reserved for future use.
If a code object represents a function, the first item in
\member{co_consts} is the documentation string of the
function, or \code{None} if undefined.
\index{documentation string}
The following flag bits are defined for \member{co_flags}: bit
\code{0x04} is set if the function uses the \samp{*arguments} syntax
to accept an arbitrary number of positional arguments; bit
\code{0x08} is set if the function uses the \samp{**keywords} syntax
to accept arbitrary keyword arguments; other bits are used internally
or reserved for future use. If\index{documentation string} a code
object represents a function, the first item in \member{co_consts} is
the documentation string of the function, or \code{None} if undefined.
\item[Frame objects]
Frame objects represent execution frames. They may occur in traceback
......@@ -1098,10 +1096,13 @@ three methods.
Called to implement evaluation of \code{\var{self}[\var{i}:\var{j}]}.
The returned object should be of the same type as \var{self}. Note
that missing \var{i} or \var{j} in the slice expression are replaced
by zero or \code{sys.maxint}, respectively, and no further
transformations on the indices is performed. The interpretation of
negative indices and indices larger than the length of the sequence is
up to the method.
by zero or \code{sys.maxint}, respectively. If negative indexes are
used in the slice, the length of the sequence is added to that index.
If the instance does not implement the \method{__len__()} method, an
\exception{AttributeError} is raised.
No guarantee is made that indexes adjusted this way are not still
negative. Indexes which are greater than the length of the sequence
are not modified.
\end{methoddesc}
\begin{methoddesc}[sequence object]{__setslice__}{self, i, j, sequence}
......
......@@ -183,11 +183,11 @@ statement. The \keyword{try} ... \keyword{finally} statement
specifies cleanup code which does not handle the exception, but is
executed whether an exception occurred or not in the preceding code.
Python uses the ``termination'' model of error handling: an exception
handler can find out what happened and continue execution at an outer
level, but it cannot repair the cause of the error and retry the
failing operation (except by re-entering the offending piece of
code from the top).
Python uses the ``termination'' \index{termination model}model of
error handling: an exception handler can find out what happened and
continue execution at an outer level, but it cannot repair the cause
of the error and retry the failing operation (except by re-entering
the offending piece of code from the top).
When an exception is not handled at all, the interpreter terminates
execution of the program, or returns to its interactive main loop. In
......@@ -210,5 +210,5 @@ selected exception handler as additional information. For class
exceptions, this object must be an instance of the exception class
being raised.
See also the description of the \keyword{try} and \keyword{raise}
statements in chapter \ref{compound}.
See also the description of the \keyword{try} statement in section
\ref{try} and \keyword{raise} statement in section \ref{raise}.
......@@ -115,7 +115,7 @@ evaluations of literals with the same value (either the same
occurrence in the program text or a different occurrence) may obtain
the same object or a different object with the same value.
\indexiii{immutable}{data}{type}
\indexii{immutable}{objects}
\indexii{immutable}{object}
\subsection{Parenthesized forms\label{parenthesized}}
\index{parenthesized form}
......@@ -189,7 +189,7 @@ section \ref{types}. (To summarize,the key type should be hashable,
which excludes all mutable objects.) Clashes between duplicate keys
are not detected; the last datum (textually rightmost in the display)
stored for a given key value prevails.
\indexii{immutable}{objects}
\indexii{immutable}{object}
\subsection{String conversions\label{string-conversions}}
\indexii{string}{conversion}
......@@ -338,7 +338,7 @@ extended slicing.\indexii{extended}{slicing}
The semantics for a simple slicing are as follows. The primary must
evaluate to a sequence object. The lower and upper bound expressions,
if present, must evaluate to plain integers; defaults are zero and the
sequence's length, respectively. If either bound is negative, the
\code{sys.maxint}, respectively. If either bound is negative, the
sequence's length is added to it. The slicing now selects all items
with index \var{k} such that
\code{\var{i} <= \var{k} < \var{j}} where \var{i}
......@@ -507,7 +507,7 @@ power, or a negative floating point number to a broken power), a
\exception{TypeError} exception is raised.
\section{Unary arithmetic operations\label{unary}}
\section{Unary arithmetic operations \label{unary}}
\indexiii{unary}{arithmetic}{operation}
\indexiii{unary}{bit-wise}{operation}
......@@ -526,7 +526,7 @@ The unary \code{+} (plus) operator yields its numeric argument
unchanged.
\index{plus}
The unary \code{~} (invert) operator yields the bit-wise inversion
The unary \code{\~} (invert) operator yields the bit-wise inversion
of its plain or long integer argument. The bit-wise inversion of
\code{x} is defined as \code{-(x+1)}. It only applies to integral
numbers.
......
......@@ -306,9 +306,7 @@ default value, the corresponding argument may be omitted from a call,
in which case the parameter's default value is substituted. If a
parameter has a default value, all following parameters must also have
a default value --- this is a syntactic restriction that is not
expressed by the grammar.\footnote{
Currently this is not checked; instead, \code{def f(a=1, b)} is
interpreted as \code{def f(a=1, b=None)}.}
expressed by the grammar.
\indexiii{default}{parameter}{value}
\strong{Default parameter values are evaluated when the function
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment