[Bug #1514540] Instead of putting the standard types in a section, put them in a chapter of their own. This means string methods will now show up in the ToC. (Should the types come before or after the functions+exceptions+constants chapter? I've put them after, for now.)

This commit is contained in:
Andrew M. Kuchling 2006-07-31 16:10:24 +00:00
parent fbf969928f
commit aa95fdb783
2 changed files with 30 additions and 30 deletions

View file

@ -71,12 +71,12 @@ and how to embed it in other applications.
% BUILT-INs % BUILT-INs
% ============= % =============
\input{libobjs} % Built-in Types, Exceptions and Functions \input{libobjs} % Built-in Exceptions and Functions
\input{libfuncs} \input{libfuncs}
\input{libstdtypes}
\input{libexcs} \input{libexcs}
\input{libconsts} \input{libconsts}
\input{libstdtypes} % Built-in types
% ============= % =============

View file

@ -1,4 +1,4 @@
\section{Built-in Types \label{types}} \chapter{Built-in Types \label{types}}
The following sections describe the standard types that are built into The following sections describe the standard types that are built into
the interpreter. the interpreter.
@ -24,7 +24,7 @@ and other language statements can be found in the
\citetitle[../tut/tut.html]{Python Tutorial}.) \citetitle[../tut/tut.html]{Python Tutorial}.)
\subsection{Truth Value Testing\label{truth}} \section{Truth Value Testing\label{truth}}
Any object can be tested for truth value, for use in an \keyword{if} or Any object can be tested for truth value, for use in an \keyword{if} or
\keyword{while} condition or as operand of the Boolean operations below. \keyword{while} condition or as operand of the Boolean operations below.
@ -71,7 +71,7 @@ return one of their operands.)
\index{False} \index{False}
\index{True} \index{True}
\subsection{Boolean Operations --- \section{Boolean Operations ---
\keyword{and}, \keyword{or}, \keyword{not} \keyword{and}, \keyword{or}, \keyword{not}
\label{boolean}} \label{boolean}}
@ -107,7 +107,7 @@ These only evaluate their second argument if needed for their outcome.
\end{description} \end{description}
\subsection{Comparisons \label{comparisons}} \section{Comparisons \label{comparisons}}
Comparison operations are supported by all objects. They all have the Comparison operations are supported by all objects. They all have the
same priority (which is higher than that of the Boolean operations). same priority (which is higher than that of the Boolean operations).
@ -174,7 +174,7 @@ Two more operations with the same syntactic priority,
only by sequence types (below). only by sequence types (below).
\subsection{Numeric Types --- \section{Numeric Types ---
\class{int}, \class{float}, \class{long}, \class{complex} \class{int}, \class{float}, \class{long}, \class{complex}
\label{typesnumeric}} \label{typesnumeric}}
@ -307,7 +307,7 @@ though the result's type is not necessarily int.
\end{description} \end{description}
% XXXJH exceptions: overflow (when? what operations?) zerodivision % XXXJH exceptions: overflow (when? what operations?) zerodivision
\subsubsection{Bit-string Operations on Integer Types \label{bitstring-ops}} \subsection{Bit-string Operations on Integer Types \label{bitstring-ops}}
\nodename{Bit-string Operations} \nodename{Bit-string Operations}
Plain and long integer types support additional operations that make Plain and long integer types support additional operations that make
@ -350,7 +350,7 @@ division by \code{pow(2, \var{n})} without overflow check.
\end{description} \end{description}
\subsection{Iterator Types \label{typeiter}} \section{Iterator Types \label{typeiter}}
\versionadded{2.2} \versionadded{2.2}
\index{iterator protocol} \index{iterator protocol}
@ -414,7 +414,7 @@ return an iterator object (technically, a generator object)
supplying the \method{__iter__()} and \method{next()} methods. supplying the \method{__iter__()} and \method{next()} methods.
\subsection{Sequence Types --- \section{Sequence Types ---
\class{str}, \class{unicode}, \class{list}, \class{str}, \class{unicode}, \class{list},
\class{tuple}, \class{buffer}, \class{xrange} \class{tuple}, \class{buffer}, \class{xrange}
\label{typesseq}} \label{typesseq}}
@ -566,7 +566,7 @@ linear concatenation performance across versions and implementations.
\end{description} \end{description}
\subsubsection{String Methods \label{string-methods}} \subsection{String Methods \label{string-methods}}
\indexii{string}{methods} \indexii{string}{methods}
These are the string methods which both 8-bit strings and Unicode These are the string methods which both 8-bit strings and Unicode
@ -901,7 +901,7 @@ of length \var{width}. The original string is returned if
\end{methoddesc} \end{methoddesc}
\subsubsection{String Formatting Operations \label{typesseq-strings}} \subsection{String Formatting Operations \label{typesseq-strings}}
\index{formatting, string (\%{})} \index{formatting, string (\%{})}
\index{interpolation, string (\%{})} \index{interpolation, string (\%{})}
@ -1072,7 +1072,7 @@ Additional string operations are defined in standard modules
\refmodule{re}.\refstmodindex{re} \refmodule{re}.\refstmodindex{re}
\subsubsection{XRange Type \label{typesseq-xrange}} \subsection{XRange Type \label{typesseq-xrange}}
The \class{xrange}\obindex{xrange} type is an immutable sequence which The \class{xrange}\obindex{xrange} type is an immutable sequence which
is commonly used for looping. The advantage of the \class{xrange} is commonly used for looping. The advantage of the \class{xrange}
@ -1084,7 +1084,7 @@ XRange objects have very little behavior: they only support indexing,
iteration, and the \function{len()} function. iteration, and the \function{len()} function.
\subsubsection{Mutable Sequence Types \label{typesseq-mutable}} \subsection{Mutable Sequence Types \label{typesseq-mutable}}
List objects support additional operations that allow in-place List objects support additional operations that allow in-place
modification of the object. modification of the object.
@ -1216,7 +1216,7 @@ Notes:
that the list has been mutated during a sort. that the list has been mutated during a sort.
\end{description} \end{description}
\subsection{Set Types --- \section{Set Types ---
\class{set}, \class{frozenset} \class{set}, \class{frozenset}
\label{types-set}} \label{types-set}}
\obindex{set} \obindex{set}
@ -1355,7 +1355,7 @@ The design of the set types was based on lessons learned from the
\end{seealso} \end{seealso}
\subsection{Mapping Types --- \class{dict} \label{typesmapping}} \section{Mapping Types --- \class{dict} \label{typesmapping}}
\obindex{mapping} \obindex{mapping}
\obindex{dictionary} \obindex{dictionary}
@ -1518,7 +1518,7 @@ For an example, see \module{collections}.\class{defaultdict}.
\end{description} \end{description}
\subsection{File Objects \section{File Objects
\label{bltin-file-objects}} \label{bltin-file-objects}}
File objects\obindex{file} are implemented using C's \code{stdio} File objects\obindex{file} are implemented using C's \code{stdio}
@ -1797,7 +1797,7 @@ implemented in C will have to provide a writable
\end{memberdesc} \end{memberdesc}
\subsection{Context Manager Types \label{typecontextmanager}} \section{Context Manager Types \label{typecontextmanager}}
\versionadded{2.5} \versionadded{2.5}
\index{context manager} \index{context manager}
@ -1878,13 +1878,13 @@ runtime context, the overhead of a single class dictionary lookup
is negligible. is negligible.
\subsection{Other Built-in Types \label{typesother}} \section{Other Built-in Types \label{typesother}}
The interpreter supports several other kinds of objects. The interpreter supports several other kinds of objects.
Most of these support only one or two operations. Most of these support only one or two operations.
\subsubsection{Modules \label{typesmodules}} \subsection{Modules \label{typesmodules}}
The only special operation on a module is attribute access: The only special operation on a module is attribute access:
\code{\var{m}.\var{name}}, where \var{m} is a module and \var{name} \code{\var{m}.\var{name}}, where \var{m} is a module and \var{name}
@ -1910,14 +1910,14 @@ written as \code{<module 'os' from
'/usr/local/lib/python\shortversion/os.pyc'>}. '/usr/local/lib/python\shortversion/os.pyc'>}.
\subsubsection{Classes and Class Instances \label{typesobjects}} \subsection{Classes and Class Instances \label{typesobjects}}
\nodename{Classes and Instances} \nodename{Classes and Instances}
See chapters 3 and 7 of the \citetitle[../ref/ref.html]{Python See chapters 3 and 7 of the \citetitle[../ref/ref.html]{Python
Reference Manual} for these. Reference Manual} for these.
\subsubsection{Functions \label{typesfunctions}} \subsection{Functions \label{typesfunctions}}
Function objects are created by function definitions. The only Function objects are created by function definitions. The only
operation on a function object is to call it: operation on a function object is to call it:
@ -1931,7 +1931,7 @@ different object types.
See the \citetitle[../ref/ref.html]{Python Reference Manual} for more See the \citetitle[../ref/ref.html]{Python Reference Manual} for more
information. information.
\subsubsection{Methods \label{typesmethods}} \subsection{Methods \label{typesmethods}}
\obindex{method} \obindex{method}
Methods are functions that are called using the attribute notation. Methods are functions that are called using the attribute notation.
@ -1976,7 +1976,7 @@ See the \citetitle[../ref/ref.html]{Python Reference Manual} for more
information. information.
\subsubsection{Code Objects \label{bltin-code-objects}} \subsection{Code Objects \label{bltin-code-objects}}
\obindex{code} \obindex{code}
Code objects are used by the implementation to represent Code objects are used by the implementation to represent
@ -1999,7 +1999,7 @@ See the \citetitle[../ref/ref.html]{Python Reference Manual} for more
information. information.
\subsubsection{Type Objects \label{bltin-type-objects}} \subsection{Type Objects \label{bltin-type-objects}}
Type objects represent the various object types. An object's type is Type objects represent the various object types. An object's type is
accessed by the built-in function \function{type()}. There are no special accessed by the built-in function \function{type()}. There are no special
@ -2011,7 +2011,7 @@ for all standard built-in types.
Types are written like this: \code{<type 'int'>}. Types are written like this: \code{<type 'int'>}.
\subsubsection{The Null Object \label{bltin-null-object}} \subsection{The Null Object \label{bltin-null-object}}
This object is returned by functions that don't explicitly return a This object is returned by functions that don't explicitly return a
value. It supports no special operations. There is exactly one null value. It supports no special operations. There is exactly one null
@ -2020,7 +2020,7 @@ object, named \code{None} (a built-in name).
It is written as \code{None}. It is written as \code{None}.
\subsubsection{The Ellipsis Object \label{bltin-ellipsis-object}} \subsection{The Ellipsis Object \label{bltin-ellipsis-object}}
This object is used by extended slice notation (see the This object is used by extended slice notation (see the
\citetitle[../ref/ref.html]{Python Reference Manual}). It supports no \citetitle[../ref/ref.html]{Python Reference Manual}). It supports no
@ -2029,7 +2029,7 @@ special operations. There is exactly one ellipsis object, named
It is written as \code{Ellipsis}. It is written as \code{Ellipsis}.
\subsubsection{Boolean Values} \subsection{Boolean Values}
Boolean values are the two constant objects \code{False} and Boolean values are the two constant objects \code{False} and
\code{True}. They are used to represent truth values (although other \code{True}. They are used to represent truth values (although other
@ -2046,14 +2046,14 @@ They are written as \code{False} and \code{True}, respectively.
\indexii{Boolean}{values} \indexii{Boolean}{values}
\subsubsection{Internal Objects \label{typesinternal}} \subsection{Internal Objects \label{typesinternal}}
See the \citetitle[../ref/ref.html]{Python Reference Manual} for this See the \citetitle[../ref/ref.html]{Python Reference Manual} for this
information. It describes stack frame objects, traceback objects, and information. It describes stack frame objects, traceback objects, and
slice objects. slice objects.
\subsection{Special Attributes \label{specialattrs}} \section{Special Attributes \label{specialattrs}}
The implementation adds a few special read-only attributes to several The implementation adds a few special read-only attributes to several
object types, where they are relevant. Some of these are not reported object types, where they are relevant. Some of these are not reported