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. ...@@ -226,6 +226,19 @@ distribution, to create or maintain whole documents or sections.
macros. This section contains the reference material for these macros. This section contains the reference material for these
facilities. 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}} \subsection{Information Units \label{info-units}}
XXX Explain terminology, or come up with something more ``lay.'' XXX Explain terminology, or come up with something more ``lay.''
...@@ -412,7 +425,8 @@ distribution, to create or maintain whole documents or sections. ...@@ -412,7 +425,8 @@ distribution, to create or maintain whole documents or sections.
\begin{macrodesc}{email}{\p{address}} \begin{macrodesc}{email}{\p{address}}
An email address. Note that this is \emph{not} hyperlinked in 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} \end{macrodesc}
\begin{macrodesc}{emph}{\p{text}} \begin{macrodesc}{emph}{\p{text}}
...@@ -689,8 +703,8 @@ distribution, to create or maintain whole documents or sections. ...@@ -689,8 +703,8 @@ distribution, to create or maintain whole documents or sections.
An additional table-like environment is \env{synopsistable}. The An additional table-like environment is \env{synopsistable}. The
table generated by this environment contains two columns, and each table generated by this environment contains two columns, and each
row is defined by an alternate definition of row is defined by an alternate definition of
\macro{modulesynopsis}. This environment is not normally use by \macro{modulesynopsis}. This environment is not normally used by
the user, but is created by the \macro{localmoduletable} macro. authors, but is created by the \macro{localmoduletable} macro.
\subsection{Reference List Markup \label{references}} \subsection{Reference List Markup \label{references}}
...@@ -726,7 +740,7 @@ distribution, to create or maintain whole documents or sections. ...@@ -726,7 +740,7 @@ distribution, to create or maintain whole documents or sections.
\subsection{Index-generating Markup \label{indexing}} \subsection{Index-generating Markup \label{indexing}}
Effective index generation for technical documents can be very 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 the creation of indexes. Much of the difficulty arises in the
area of terminology: including the terms an expert would use for a area of terminology: including the terms an expert would use for a
concept is not sufficient. Coming up with the terms that a novice 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. ...@@ -735,7 +749,7 @@ distribution, to create or maintain whole documents or sections.
The truly difficult aspects of index generation are not areas with The truly difficult aspects of index generation are not areas with
which the documentation tools can help. However, ease 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 the scope of the tools. Markup is provided which the processing
software is able to use to generate a variety of kinds of index software is able to use to generate a variety of kinds of index
entry with minimal effort. Additionally, many of the environments entry with minimal effort. Additionally, many of the environments
......
...@@ -53,7 +53,9 @@ mac: mac/mac.html ...@@ -53,7 +53,9 @@ mac: mac/mac.html
ref: ref/ref.html ref: ref/ref.html
tut: tut/tut.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. # The index.html target is at the end since it screws up font-lock.
......
<html> <html>
<head> <head>
<title>Python 1.5.2 Documentation</title> <title>Python @RELEASE@ Documentation - @DATE@</title>
<link rel=STYLESHEET href="lib/lib.css" type="text/css"> <link rel=STYLESHEET href="lib/lib.css" type="text/css">
<style type="text/css"> <style type="text/css">
a.title { font-weight: bold; font-size: 110%; } a.title { font-weight: bold; font-size: 110%; }
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</p> </p>
</div> </div>
<table> <table align="center">
<tbody> <tbody>
<tr><td> <tr><td>
<ul> <ul>
......
...@@ -13,3 +13,4 @@ ...@@ -13,3 +13,4 @@
*.l2h *.l2h
*.how *.how
README README
api.tex
...@@ -58,17 +58,20 @@ pdf: $(PDFFILES) ...@@ -58,17 +58,20 @@ pdf: $(PDFFILES)
ps: $(PSFILES) ps: $(PSFILES)
README: $(PSFILES) README: $(PSFILES) $(TOOLSDIR)/getpagecounts
$(TOOLSDIR)/getpagecounts >$@ $(TOOLSDIR)/getpagecounts >$@
# Python/C API Reference Manual # Python/C API Reference Manual
api.dvi: $(APIFILES) api.dvi: api.tex $(APIFILES)
$(MKDVI) api $(MKDVI) api
api.pdf: $(APIFILES) api.pdf: api.tex $(APIFILES)
$(MKPDF) api $(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 # Documenting Python
doc.dvi: $(DOCFILES) doc.dvi: $(DOCFILES)
$(MKHOWTO) --dvi ../doc/doc.tex $(MKHOWTO) --dvi ../doc/doc.tex
...@@ -113,7 +116,7 @@ tut.pdf: $(TUTFILES) ...@@ -113,7 +116,7 @@ tut.pdf: $(TUTFILES)
clean: 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 clobber: clean
rm -f $(DVIFILES) $(PSFILES) $(PDFFILES) rm -f $(DVIFILES) $(PSFILES) $(PDFFILES)
......
...@@ -38,14 +38,14 @@ sub show{ ...@@ -38,14 +38,14 @@ sub show{
sub tohtml{ sub tohtml{
my $self = shift; my $self = shift;
my $data = "<table class=\"synopsistable\">\n"; my $data = "<table class='synopsistable'>\n";
my $name; my $name;
foreach $name (split /,/, $self->{names}) { foreach $name (split /,/, $self->{names}) {
my($key,$type,$synopsis) = $self->get($name); my($key,$type,$synopsis) = $self->get($name);
my $link = "<a href=\"module-$key.html\">"; my $link = "<a href='module-$key.html'>";
$data .= (" <tr>" $data .= (' <tr>'
. "<td><b><tt class=module>$link$name</a></tt></b></td>\n" . "<td><b><tt class='module'>$link$name</a></tt></b></td>\n"
. " <td class=synopsis>$synopsis</td></tr>\n"); . " <td class='synopsis'>$synopsis</td></tr>\n");
} }
$data .= "</table>\n"; $data .= "</table>\n";
$data; $data;
......
...@@ -16,6 +16,7 @@ package main; ...@@ -16,6 +16,7 @@ package main;
$HTML_VERSION = 4.0; $HTML_VERSION = 4.0;
$MAX_LINK_DEPTH = 2; $MAX_LINK_DEPTH = 2;
$MAX_SPLIT_DEPTH = 5; # split at subsections but not sub-subsections
$ADDRESS = ''; $ADDRESS = '';
$NO_FOOTNODE = 1; $NO_FOOTNODE = 1;
...@@ -143,22 +144,22 @@ sub adjust_icon_information{ ...@@ -143,22 +144,22 @@ sub adjust_icon_information{
$BLANK_ICON =~ s/alt="blank"/alt=""/; $BLANK_ICON =~ s/alt="blank"/alt=""/;
$NAV_BGCOLOR = " bgcolor=\"#99CCFF\""; $NAV_BGCOLOR = " bgcolor=\"#99CCFF\"";
} }
adjust_icon_information(); adjust_icon_information();
sub make_nav_sectref{ sub make_nav_sectref{
my($label,$title) = @_; my($label,$title) = @_;
if ($title) { if ($title) {
$title =~ s/<A/<A class=sectref/; return ("<b class='navlabel'>$label:</b> "
return ("<b class=navlabel>$label:</b> " . "<span class='sectref'>$title</span>\n");
. "$title\n");
} }
return ''; return '';
} }
sub make_nav_panel{ sub make_nav_panel{
my $s; 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<tr>"
. "\n<td>$NEXT</td>" . "\n<td>$NEXT</td>"
. "\n<td>$UP</td>" . "\n<td>$UP</td>"
...@@ -184,13 +185,13 @@ sub make_nav_panel{ ...@@ -184,13 +185,13 @@ sub make_nav_panel{
} }
sub top_navigation_panel { sub top_navigation_panel {
"<div class=navigation>\n" "<div class='navigation'>\n"
. make_nav_panel() . make_nav_panel()
. '<br><hr></div>'; . '<br><hr></div>';
} }
sub bot_navigation_panel { sub bot_navigation_panel {
"<p>\n<div class=navigation><hr>" "<p>\n<div class='navigation'><hr>"
. make_nav_panel() . make_nav_panel()
. '</div>'; . '</div>';
} }
...@@ -334,13 +335,11 @@ sub add_module_idx{ ...@@ -334,13 +335,11 @@ sub add_module_idx{
my $plat = ''; my $plat = '';
$key =~ s/<tt>([a-zA-Z0-9._]*)<\/tt>/\1/; $key =~ s/<tt>([a-zA-Z0-9._]*)<\/tt>/\1/;
if ($ModulePlatforms{$key} && !$allthesame) { if ($ModulePlatforms{$key} && !$allthesame) {
$plat = (" <em>(<span class=platform>$ModulePlatforms{$key}" $plat = (" <em>(<span class='platform'>$ModulePlatforms{$key}"
. '</span>)</em>'); . '</span>)</em>');
} }
print MODIDXFILE print MODIDXFILE $moditem . $IDXFILE_FIELD_SEP
$moditem . "<tt class='module'>$key</tt>$plat###\n";
. $IDXFILE_FIELD_SEP
. "<tt class=module>$key</tt>$plat###\n";
} }
close(MODIDXFILE); close(MODIDXFILE);
if (!$allthesame) { if (!$allthesame) {
...@@ -556,9 +555,55 @@ sub protect_useritems { ...@@ -556,9 +555,55 @@ sub protect_useritems {
# #
# Note that this *must* be done in the init file, not the python.perl # Note that this *must* be done in the init file, not the python.perl
# style support file. The %declarations must be set before initialize() # 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); %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 1; # This must be the last line
...@@ -15,13 +15,13 @@ sub ltx_next_argument{ ...@@ -15,13 +15,13 @@ sub ltx_next_argument{
sub do_cmd_macro{ sub do_cmd_macro{
local($_) = @_; local($_) = @_;
my $macro = ltx_next_argument(); my $macro = ltx_next_argument();
return "<tt class=macro>&#92;$macro</tt>" . $_; return "<tt class='macro'>&#92;$macro</tt>" . $_;
} }
sub do_cmd_env{ sub do_cmd_env{
local($_) = @_; local($_) = @_;
my $env = ltx_next_argument(); my $env = ltx_next_argument();
return "<tt class=environment>&#92;$env</tt>" . $_; return "<tt class='environment'>&#92;$env</tt>" . $_;
} }
sub ltx_process_params{ sub ltx_process_params{
...@@ -43,8 +43,8 @@ sub do_env_macrodesc{ ...@@ -43,8 +43,8 @@ sub do_env_macrodesc{
local($_) = @_; local($_) = @_;
my $macro = ltx_next_argument(); my $macro = ltx_next_argument();
my $params = ltx_process_params(ltx_next_argument()); my $params = ltx_process_params(ltx_next_argument());
return "\n<dl class=macrodesc>" return "\n<dl class='macrodesc'>"
. "\n<dt><b><tt class=macro>&#92;$macro</tt></b>" . "\n<dt><b><tt class='macro'>&#92;$macro</tt></b>"
. "\n $params" . "\n $params"
. "\n<dd>" . "\n<dd>"
. $_ . $_
...@@ -55,9 +55,10 @@ sub do_env_envdesc{ ...@@ -55,9 +55,10 @@ sub do_env_envdesc{
local($_) = @_; local($_) = @_;
my $env = ltx_next_argument(); my $env = ltx_next_argument();
my $params = ltx_process_params(ltx_next_argument()); my $params = ltx_process_params(ltx_next_argument());
return "\n<dl class=envdesc>" return "\n<dl class='envdesc'>"
. "\n<dt><tt>&#92;begin{<b class=environment>$env</b>}</tt>" . "\n<dt><tt>&#92;begin{<b class='environment'>$env</b>}</tt>"
. "\n $params" . "\n $params"
. "\n<br /><tt>&#92;end{<b class='environment'>$env</b>}</tt>"
. "\n<dd>" . "\n<dd>"
. $_ . $_
. "</dl>"; . "</dl>";
......
This diff is collapsed.
...@@ -148,7 +148,7 @@ text editors on non-UNIX platforms, it is unwise to use a mixture of ...@@ -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. 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 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 characters occurring elsewhere in the leading whitespace have an
undefined effect (for instance, they may reset the space count to undefined effect (for instance, they may reset the space count to
zero). zero).
...@@ -369,7 +369,9 @@ characters: a backslash and a double quote; \code{r"\e"} is not a value ...@@ -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 string literal (even a raw string cannot end in an odd number of
backslashes). Specifically, \emph{a raw string cannot end in a single backslashes). Specifically, \emph{a raw string cannot end in a single
backslash} (since the backslash would escape the following quote 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}} \subsection{String literal concatenation\label{string-catenation}}
...@@ -464,7 +466,9 @@ exponent: ("e"|"E") ["+"|"-"] digit+ ...@@ -464,7 +466,9 @@ exponent: ("e"|"E") ["+"|"-"] digit+
\end{verbatim} \end{verbatim}
Note that the integer part of a floating point number cannot look like 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 The allowed range of floating point literals is
implementation-dependent. implementation-dependent.
Some examples of floating point literals: Some examples of floating point literals:
...@@ -485,7 +489,7 @@ Imaginary literals are described by the following lexical definitions: ...@@ -485,7 +489,7 @@ Imaginary literals are described by the following lexical definitions:
imagnumber: (floatnumber | intpart) ("j"|"J") imagnumber: (floatnumber | intpart) ("j"|"J")
\end{verbatim} \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 0.0. Complex numbers are represented as a pair of floating point
numbers and have the same restrictions on their range. To create a numbers and have the same restrictions on their range. To create a
complex number with a nonzero real part, add a floating point number 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: ...@@ -522,7 +526,7 @@ The following tokens serve as delimiters in the grammar:
\end{verbatim} \end{verbatim}
The period can also occur in floating-point and imaginary literals. A 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 The following printing ASCII characters have special meaning as part
of other tokens or are otherwise significant to the lexical analyzer: of other tokens or are otherwise significant to the lexical analyzer:
......
...@@ -144,7 +144,6 @@ arithmetic operators and arithmetic built-in functions. Numeric ...@@ -144,7 +144,6 @@ arithmetic operators and arithmetic built-in functions. Numeric
objects are immutable; once created their value never changes. Python objects are immutable; once created their value never changes. Python
numbers are of course strongly related to mathematical numbers, but numbers are of course strongly related to mathematical numbers, but
subject to the limitations of numerical representation in computers. subject to the limitations of numerical representation in computers.
\obindex{number}
\obindex{numeric} \obindex{numeric}
Python distinguishes between integers and floating point numbers: Python distinguishes between integers and floating point numbers:
...@@ -162,7 +161,7 @@ There are two types of integers: ...@@ -162,7 +161,7 @@ There are two types of integers:
These represent numbers in the range -2147483648 through 2147483647. These represent numbers in the range -2147483648 through 2147483647.
(The range may be larger on machines with a larger natural word (The range may be larger on machines with a larger natural word
size, but not smaller.) 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. exception \exception{OverflowError} is raised.
For the purpose of shift and mask operations, integers are assumed to 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 have a binary, 2's complement notation using 32 or more bits, and
...@@ -221,7 +220,7 @@ number of items of a sequence. ...@@ -221,7 +220,7 @@ number of items of a sequence.
When the lenth of a sequence is \var{n}, the When the lenth of a sequence is \var{n}, the
index set contains the numbers 0, 1, \ldots, \var{n}-1. Item 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}]}. \var{i} of sequence \var{a} is selected by \code{\var{a}[\var{i}]}.
\obindex{seqence} \obindex{sequence}
\index{index operation} \index{index operation}
\index{item selection} \index{item selection}
\index{subscription} \index{subscription}
...@@ -618,7 +617,7 @@ instance dictionary directly. ...@@ -618,7 +617,7 @@ instance dictionary directly.
Class instances can pretend to be numbers, sequences, or mappings if Class instances can pretend to be numbers, sequences, or mappings if
they have methods with certain special names. See they have methods with certain special names. See
section \ref{specialnames}, ``Special method names.'' section \ref{specialnames}, ``Special method names.''
\obindex{number} \obindex{numeric}
\obindex{sequence} \obindex{sequence}
\obindex{mapping} \obindex{mapping}
...@@ -702,15 +701,14 @@ a number of flags for the interpreter. ...@@ -702,15 +701,14 @@ a number of flags for the interpreter.
\ttindex{co_stacksize} \ttindex{co_stacksize}
\ttindex{co_varnames}} \ttindex{co_varnames}}
The following flag bits are defined for \member{co_flags}: bit 2 is set The following flag bits are defined for \member{co_flags}: bit
if the function uses the \samp{*arguments} syntax to accept an \code{0x04} is set if the function uses the \samp{*arguments} syntax
arbitrary number of positional arguments; bit 3 is set if the function to accept an arbitrary number of positional arguments; bit
uses the \samp{**keywords} syntax to accept arbitrary keyword \code{0x08} is set if the function uses the \samp{**keywords} syntax
arguments; other bits are used internally or reserved for future use. to accept arbitrary keyword arguments; other bits are used internally
If a code object represents a function, the first item in or reserved for future use. If\index{documentation string} a code
\member{co_consts} is the documentation string of the object represents a function, the first item in \member{co_consts} is
function, or \code{None} if undefined. the documentation string of the function, or \code{None} if undefined.
\index{documentation string}
\item[Frame objects] \item[Frame objects]
Frame objects represent execution frames. They may occur in traceback Frame objects represent execution frames. They may occur in traceback
...@@ -1098,10 +1096,13 @@ three methods. ...@@ -1098,10 +1096,13 @@ three methods.
Called to implement evaluation of \code{\var{self}[\var{i}:\var{j}]}. 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 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 that missing \var{i} or \var{j} in the slice expression are replaced
by zero or \code{sys.maxint}, respectively, and no further by zero or \code{sys.maxint}, respectively. If negative indexes are
transformations on the indices is performed. The interpretation of used in the slice, the length of the sequence is added to that index.
negative indices and indices larger than the length of the sequence is If the instance does not implement the \method{__len__()} method, an
up to the method. \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} \end{methoddesc}
\begin{methoddesc}[sequence object]{__setslice__}{self, i, j, sequence} \begin{methoddesc}[sequence object]{__setslice__}{self, i, j, sequence}
......
...@@ -183,11 +183,11 @@ statement. The \keyword{try} ... \keyword{finally} statement ...@@ -183,11 +183,11 @@ statement. The \keyword{try} ... \keyword{finally} statement
specifies cleanup code which does not handle the exception, but is specifies cleanup code which does not handle the exception, but is
executed whether an exception occurred or not in the preceding code. executed whether an exception occurred or not in the preceding code.
Python uses the ``termination'' model of error handling: an exception Python uses the ``termination'' \index{termination model}model of
handler can find out what happened and continue execution at an outer error handling: an exception handler can find out what happened and
level, but it cannot repair the cause of the error and retry the continue execution at an outer level, but it cannot repair the cause
failing operation (except by re-entering the offending piece of of the error and retry the failing operation (except by re-entering
code from the top). the offending piece of code from the top).
When an exception is not handled at all, the interpreter terminates When an exception is not handled at all, the interpreter terminates
execution of the program, or returns to its interactive main loop. In execution of the program, or returns to its interactive main loop. In
...@@ -210,5 +210,5 @@ selected exception handler as additional information. For class ...@@ -210,5 +210,5 @@ selected exception handler as additional information. For class
exceptions, this object must be an instance of the exception class exceptions, this object must be an instance of the exception class
being raised. being raised.
See also the description of the \keyword{try} and \keyword{raise} See also the description of the \keyword{try} statement in section
statements in chapter \ref{compound}. \ref{try} and \keyword{raise} statement in section \ref{raise}.
...@@ -115,7 +115,7 @@ evaluations of literals with the same value (either the same ...@@ -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 occurrence in the program text or a different occurrence) may obtain
the same object or a different object with the same value. the same object or a different object with the same value.
\indexiii{immutable}{data}{type} \indexiii{immutable}{data}{type}
\indexii{immutable}{objects} \indexii{immutable}{object}
\subsection{Parenthesized forms\label{parenthesized}} \subsection{Parenthesized forms\label{parenthesized}}
\index{parenthesized form} \index{parenthesized form}
...@@ -189,7 +189,7 @@ section \ref{types}. (To summarize,the key type should be hashable, ...@@ -189,7 +189,7 @@ section \ref{types}. (To summarize,the key type should be hashable,
which excludes all mutable objects.) Clashes between duplicate keys which excludes all mutable objects.) Clashes between duplicate keys
are not detected; the last datum (textually rightmost in the display) are not detected; the last datum (textually rightmost in the display)
stored for a given key value prevails. stored for a given key value prevails.
\indexii{immutable}{objects} \indexii{immutable}{object}
\subsection{String conversions\label{string-conversions}} \subsection{String conversions\label{string-conversions}}
\indexii{string}{conversion} \indexii{string}{conversion}
...@@ -338,7 +338,7 @@ extended slicing.\indexii{extended}{slicing} ...@@ -338,7 +338,7 @@ extended slicing.\indexii{extended}{slicing}
The semantics for a simple slicing are as follows. The primary must The semantics for a simple slicing are as follows. The primary must
evaluate to a sequence object. The lower and upper bound expressions, evaluate to a sequence object. The lower and upper bound expressions,
if present, must evaluate to plain integers; defaults are zero and the 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 sequence's length is added to it. The slicing now selects all items
with index \var{k} such that with index \var{k} such that
\code{\var{i} <= \var{k} < \var{j}} where \var{i} \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 ...@@ -507,7 +507,7 @@ power, or a negative floating point number to a broken power), a
\exception{TypeError} exception is raised. \exception{TypeError} exception is raised.
\section{Unary arithmetic operations\label{unary}} \section{Unary arithmetic operations \label{unary}}
\indexiii{unary}{arithmetic}{operation} \indexiii{unary}{arithmetic}{operation}
\indexiii{unary}{bit-wise}{operation} \indexiii{unary}{bit-wise}{operation}
...@@ -526,7 +526,7 @@ The unary \code{+} (plus) operator yields its numeric argument ...@@ -526,7 +526,7 @@ The unary \code{+} (plus) operator yields its numeric argument
unchanged. unchanged.
\index{plus} \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 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 \code{x} is defined as \code{-(x+1)}. It only applies to integral
numbers. numbers.
......
...@@ -306,9 +306,7 @@ default value, the corresponding argument may be omitted from a call, ...@@ -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 in which case the parameter's default value is substituted. If a
parameter has a default value, all following parameters must also have parameter has a default value, all following parameters must also have
a default value --- this is a syntactic restriction that is not a default value --- this is a syntactic restriction that is not
expressed by the grammar.\footnote{ expressed by the grammar.
Currently this is not checked; instead, \code{def f(a=1, b)} is
interpreted as \code{def f(a=1, b=None)}.}
\indexiii{default}{parameter}{value} \indexiii{default}{parameter}{value}
\strong{Default parameter values are evaluated when the function \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