Change "\," to just "," in function signatures. This is easier to maintain,

works better with LaTeX2HTML, and allows some simplification of the python.sty
macros.
This commit is contained in:
Fred Drake 1998-03-17 06:33:25 +00:00
parent c9a4438c16
commit cce1090d49
129 changed files with 705 additions and 703 deletions

View file

@ -24,7 +24,7 @@ second's worth occupies 2*2*44100 bytes, i.e.\ 176,400 bytes.
Module \code{aifc} defines the following function: Module \code{aifc} defines the following function:
\setindexsubitem{(in module aifc)} \setindexsubitem{(in module aifc)}
\begin{funcdesc}{open}{file\, mode} \begin{funcdesc}{open}{file, mode}
Open an AIFF or AIFF-C file and return an object instance with Open an AIFF or AIFF-C file and return an object instance with
methods that are described below. The argument file is either a methods that are described below. The argument file is either a
string naming a file or a file object. The mode is either the string string naming a file or a file object. The mode is either the string
@ -146,7 +146,7 @@ If this parameter is not set, or not set correctly, the file needs to
support seeking. support seeking.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setcomptype}{type\, name} \begin{funcdesc}{setcomptype}{type, name}
Specify the compression type. If not specified, the audio data will Specify the compression type. If not specified, the audio data will
not be compressed. In AIFF files, compression is not possible. The not be compressed. In AIFF files, compression is not possible. The
name parameter should be a human-readable description of the name parameter should be a human-readable description of the
@ -155,14 +155,14 @@ string. Currently the following compression types are supported:
NONE, ULAW, ALAW, G722. NONE, ULAW, ALAW, G722.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setparams}{nchannels\, sampwidth\, framerate\, comptype\, compname} \begin{funcdesc}{setparams}{nchannels, sampwidth, framerate, comptype, compname}
Set all the above parameters at once. The argument is a tuple Set all the above parameters at once. The argument is a tuple
consisting of the various parameters. This means that it is possible consisting of the various parameters. This means that it is possible
to use the result of a \code{getparams()} call as argument to to use the result of a \code{getparams()} call as argument to
\code{setparams()}. \code{setparams()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setmark}{id\, pos\, name} \begin{funcdesc}{setmark}{id, pos, name}
Add a mark with the given id (larger than 0), and the given name at Add a mark with the given id (larger than 0), and the given name at
the given position. This method can be called at any time before the given position. This method can be called at any time before
\code{close()}. \code{close()}.

View file

@ -27,7 +27,7 @@ The module defines the following functions:
\setindexsubitem{(in module al)} \setindexsubitem{(in module al)}
\begin{funcdesc}{openport}{name\, direction\optional{\, config}} \begin{funcdesc}{openport}{name, direction\optional{, config}}
The name and direction arguments are strings. The optional config The name and direction arguments are strings. The optional config
argument is a configuration object as returned by argument is a configuration object as returned by
\code{al.newconfig()}. The return value is an \dfn{port object}; \code{al.newconfig()}. The return value is an \dfn{port object};
@ -44,12 +44,12 @@ The device argument is an integer. The return value is a list of
integers containing the data returned by ALqueryparams(). integers containing the data returned by ALqueryparams().
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{getparams}{device\, list} \begin{funcdesc}{getparams}{device, list}
The device argument is an integer. The list argument is a list such The device argument is an integer. The list argument is a list such
as returned by \code{queryparams}; it is modified in place (!). as returned by \code{queryparams}; it is modified in place (!).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setparams}{device\, list} \begin{funcdesc}{setparams}{device, list}
The device argument is an integer. The list argument is a list such The device argument is an integer. The list argument is a list such
as returned by \code{al.queryparams}. as returned by \code{al.queryparams}.
\end{funcdesc} \end{funcdesc}

View file

@ -12,7 +12,7 @@ the exception \code{amoeba.error = 'amoeba.error'}.
The module \code{amoeba} defines the following items: The module \code{amoeba} defines the following items:
\setindexsubitem{(in module amoeba)} \setindexsubitem{(in module amoeba)}
\begin{funcdesc}{name_append}{path\, cap} \begin{funcdesc}{name_append}{path, cap}
Stores a capability in the Amoeba directory tree. Stores a capability in the Amoeba directory tree.
Arguments are the pathname (a string) and the capability (a capability Arguments are the pathname (a string) and the capability (a capability
object as returned by object as returned by
@ -32,7 +32,7 @@ Returns a
object, to which various interesting operations apply, described below. object, to which various interesting operations apply, described below.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{name_replace}{path\, cap} \begin{funcdesc}{name_replace}{path, cap}
Replaces a capability in the Amoeba directory tree. Replaces a capability in the Amoeba directory tree.
Arguments are the pathname and the new capability. Arguments are the pathname and the new capability.
(This differs from (This differs from
@ -91,7 +91,7 @@ The following methods are defined for capability objects.
Returns a list of the names of the entries in an Amoeba directory. Returns a list of the names of the entries in an Amoeba directory.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{b_read}{offset\, maxsize} \begin{funcdesc}{b_read}{offset, maxsize}
Reads (at most) Reads (at most)
\var{maxsize} \var{maxsize}
bytes from a bullet file at offset bytes from a bullet file at offset

View file

@ -13,7 +13,7 @@ will be used. Both modules provide the same interface:
% at the same time. % at the same time.
\setindexsubitem{(in modules anydbm, dumbdbm)} \setindexsubitem{(in modules anydbm, dumbdbm)}
\begin{funcdesc}{open}{filename\optional{\, flag\, mode}} \begin{funcdesc}{open}{filename\optional{, flag, mode}}
Open the database file \var{filename} and return a corresponding object. Open the database file \var{filename} and return a corresponding object.
The optional \var{flag} argument can be The optional \var{flag} argument can be
\code{'r'} to open an existing database for reading only, \code{'r'} to open an existing database for reading only,

View file

@ -35,7 +35,7 @@ See also built-in module \module{struct}\refbimodindex{struct}.
The module defines the following function: The module defines the following function:
\begin{funcdesc}{array}{typecode\optional{\, initializer}} \begin{funcdesc}{array}{typecode\optional{, initializer}}
Return a new array whose items are restricted by \var{typecode}, and Return a new array whose items are restricted by \var{typecode}, and
initialized from the optional \var{initializer} value, which must be a initialized from the optional \var{initializer} value, which must be a
list or a string. The list or string is passed to the new array's list or a string. The list or string is passed to the new array's
@ -77,7 +77,7 @@ integer values. It is useful when reading data from a file written
on a machine with a different byte order. on a machine with a different byte order.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{fromfile}{f\, n} \begin{funcdesc}{fromfile}{f, n}
Read \var{n} items (as machine values) from the file object \var{f} Read \var{n} items (as machine values) from the file object \var{f}
and append them to the end of the array. If less than \var{n} items and append them to the end of the array. If less than \var{n} items
are available, \exception{EOFError} is raised, but the items that were are available, \exception{EOFError} is raised, but the items that were
@ -98,12 +98,12 @@ array of machine values (i.e. as if it had been read from a
file using the \method{fromfile()} method). file using the \method{fromfile()} method).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{insert}{i\, x} \begin{funcdesc}{insert}{i, x}
Insert a new item with value \var{x} in the array before position Insert a new item with value \var{x} in the array before position
\var{i}. \var{i}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{read}{f\, n} \begin{funcdesc}{read}{f, n}
\deprecated {1.5.1} \deprecated {1.5.1}
{Use the \method{fromfile()} method.} {Use the \method{fromfile()} method.}
Read \var{n} items (as machine values) from the file object \var{f} Read \var{n} items (as machine values) from the file object \var{f}

View file

@ -19,46 +19,46 @@ This exception is raised on all errors, such as unknown number of bytes
per sample, etc. per sample, etc.
\end{excdesc} \end{excdesc}
\begin{funcdesc}{add}{fragment1\, fragment2\, width} \begin{funcdesc}{add}{fragment1, fragment2, width}
Return a fragment which is the addition of the two samples passed as Return a fragment which is the addition of the two samples passed as
parameters. \var{width} is the sample width in bytes, either parameters. \var{width} is the sample width in bytes, either
\code{1}, \code{2} or \code{4}. Both fragments should have the same \code{1}, \code{2} or \code{4}. Both fragments should have the same
length. length.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{adpcm2lin}{adpcmfragment\, width\, state} \begin{funcdesc}{adpcm2lin}{adpcmfragment, width, state}
Decode an Intel/DVI ADPCM coded fragment to a linear fragment. See Decode an Intel/DVI ADPCM coded fragment to a linear fragment. See
the description of \code{lin2adpcm} for details on ADPCM coding. the description of \code{lin2adpcm} for details on ADPCM coding.
Return a tuple \code{(\var{sample}, \var{newstate})} where the sample Return a tuple \code{(\var{sample}, \var{newstate})} where the sample
has the width specified in \var{width}. has the width specified in \var{width}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{adpcm32lin}{adpcmfragment\, width\, state} \begin{funcdesc}{adpcm32lin}{adpcmfragment, width, state}
Decode an alternative 3-bit ADPCM code. See \code{lin2adpcm3} for Decode an alternative 3-bit ADPCM code. See \code{lin2adpcm3} for
details. details.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{avg}{fragment\, width} \begin{funcdesc}{avg}{fragment, width}
Return the average over all samples in the fragment. Return the average over all samples in the fragment.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{avgpp}{fragment\, width} \begin{funcdesc}{avgpp}{fragment, width}
Return the average peak-peak value over all samples in the fragment. Return the average peak-peak value over all samples in the fragment.
No filtering is done, so the usefulness of this routine is No filtering is done, so the usefulness of this routine is
questionable. questionable.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{bias}{fragment\, width\, bias} \begin{funcdesc}{bias}{fragment, width, bias}
Return a fragment that is the original fragment with a bias added to Return a fragment that is the original fragment with a bias added to
each sample. each sample.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{cross}{fragment\, width} \begin{funcdesc}{cross}{fragment, width}
Return the number of zero crossings in the fragment passed as an Return the number of zero crossings in the fragment passed as an
argument. argument.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{findfactor}{fragment\, reference} \begin{funcdesc}{findfactor}{fragment, reference}
Return a factor \var{F} such that Return a factor \var{F} such that
\code{rms(add(fragment, mul(reference, -F)))} is minimal, i.e., \code{rms(add(fragment, mul(reference, -F)))} is minimal, i.e.,
return the factor with which you should multiply \var{reference} to return the factor with which you should multiply \var{reference} to
@ -68,7 +68,7 @@ should both contain 2-byte samples.
The time taken by this routine is proportional to \code{len(fragment)}. The time taken by this routine is proportional to \code{len(fragment)}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{findfit}{fragment\, reference} \begin{funcdesc}{findfit}{fragment, reference}
This routine (which only accepts 2-byte sample fragments) This routine (which only accepts 2-byte sample fragments)
Try to match \var{reference} as well as possible to a portion of Try to match \var{reference} as well as possible to a portion of
@ -82,7 +82,7 @@ and \var{factor} is the (floating-point) factor as per
\code{findfactor}. \code{findfactor}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{findmax}{fragment\, length} \begin{funcdesc}{findmax}{fragment, length}
Search \var{fragment} for a slice of length \var{length} samples (not Search \var{fragment} for a slice of length \var{length} samples (not
bytes!)\ with maximum energy, i.e., return \var{i} for which bytes!)\ with maximum energy, i.e., return \var{i} for which
\code{rms(fragment[i*2:(i+length)*2])} is maximal. The fragments \code{rms(fragment[i*2:(i+length)*2])} is maximal. The fragments
@ -91,15 +91,15 @@ should both contain 2-byte samples.
The routine takes time proportional to \code{len(fragment)}. The routine takes time proportional to \code{len(fragment)}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{getsample}{fragment\, width\, index} \begin{funcdesc}{getsample}{fragment, width, index}
Return the value of sample \var{index} from the fragment. Return the value of sample \var{index} from the fragment.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{lin2lin}{fragment\, width\, newwidth} \begin{funcdesc}{lin2lin}{fragment, width, newwidth}
Convert samples between 1-, 2- and 4-byte formats. Convert samples between 1-, 2- and 4-byte formats.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{lin2adpcm}{fragment\, width\, state} \begin{funcdesc}{lin2adpcm}{fragment, width, state}
Convert samples to 4 bit Intel/DVI ADPCM encoding. ADPCM coding is an Convert samples to 4 bit Intel/DVI ADPCM encoding. ADPCM coding is an
adaptive coding scheme, whereby each 4 bit number is the difference adaptive coding scheme, whereby each 4 bit number is the difference
between one sample and the next, divided by a (varying) step. The between one sample and the next, divided by a (varying) step. The
@ -113,41 +113,41 @@ initial call \code{None} can be passed as the state. \var{adpcmfrag}
is the ADPCM coded fragment packed 2 4-bit values per byte. is the ADPCM coded fragment packed 2 4-bit values per byte.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{lin2adpcm3}{fragment\, width\, state} \begin{funcdesc}{lin2adpcm3}{fragment, width, state}
This is an alternative ADPCM coder that uses only 3 bits per sample. This is an alternative ADPCM coder that uses only 3 bits per sample.
It is not compatible with the Intel/DVI ADPCM coder and its output is It is not compatible with the Intel/DVI ADPCM coder and its output is
not packed (due to laziness on the side of the author). Its use is not packed (due to laziness on the side of the author). Its use is
discouraged. discouraged.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{lin2ulaw}{fragment\, width} \begin{funcdesc}{lin2ulaw}{fragment, width}
Convert samples in the audio fragment to U-LAW encoding and return Convert samples in the audio fragment to U-LAW encoding and return
this as a Python string. U-LAW is an audio encoding format whereby this as a Python string. U-LAW is an audio encoding format whereby
you get a dynamic range of about 14 bits using only 8 bit samples. It you get a dynamic range of about 14 bits using only 8 bit samples. It
is used by the Sun audio hardware, among others. is used by the Sun audio hardware, among others.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{minmax}{fragment\, width} \begin{funcdesc}{minmax}{fragment, width}
Return a tuple consisting of the minimum and maximum values of all Return a tuple consisting of the minimum and maximum values of all
samples in the sound fragment. samples in the sound fragment.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{max}{fragment\, width} \begin{funcdesc}{max}{fragment, width}
Return the maximum of the \emph{absolute value} of all samples in a Return the maximum of the \emph{absolute value} of all samples in a
fragment. fragment.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{maxpp}{fragment\, width} \begin{funcdesc}{maxpp}{fragment, width}
Return the maximum peak-peak value in the sound fragment. Return the maximum peak-peak value in the sound fragment.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{mul}{fragment\, width\, factor} \begin{funcdesc}{mul}{fragment, width, factor}
Return a fragment that has all samples in the original framgent Return a fragment that has all samples in the original framgent
multiplied by the floating-point value \var{factor}. Overflow is multiplied by the floating-point value \var{factor}. Overflow is
silently ignored. silently ignored.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{ratecv}{fragment\, width\, nchannels\, inrate\, outrate\, state\optional{\, weightA\, weightB}} \begin{funcdesc}{ratecv}{fragment, width, nchannels, inrate, outrate, state\optional{, weightA, weightB}}
Convert the frame rate of the input fragment. Convert the frame rate of the input fragment.
\code{State} is a tuple containing the state of the converter. The \code{State} is a tuple containing the state of the converter. The
@ -158,11 +158,11 @@ The \code{weightA} and \code{weightB} arguments are parameters for a
simple digital filter and default to 1 and 0 respectively. simple digital filter and default to 1 and 0 respectively.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{reverse}{fragment\, width} \begin{funcdesc}{reverse}{fragment, width}
Reverse the samples in a fragment and returns the modified fragment. Reverse the samples in a fragment and returns the modified fragment.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{rms}{fragment\, width} \begin{funcdesc}{rms}{fragment, width}
Return the root-mean-square of the fragment, i.e. Return the root-mean-square of the fragment, i.e.
\iftexi \iftexi
the square root of the quotient of the sum of all squared sample value, the square root of the quotient of the sum of all squared sample value,
@ -177,20 +177,20 @@ divided by the sumber of samples.
This is a measure of the power in an audio signal. This is a measure of the power in an audio signal.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{tomono}{fragment\, width\, lfactor\, rfactor} \begin{funcdesc}{tomono}{fragment, width, lfactor, rfactor}
Convert a stereo fragment to a mono fragment. The left channel is Convert a stereo fragment to a mono fragment. The left channel is
multiplied by \var{lfactor} and the right channel by \var{rfactor} multiplied by \var{lfactor} and the right channel by \var{rfactor}
before adding the two channels to give a mono signal. before adding the two channels to give a mono signal.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{tostereo}{fragment\, width\, lfactor\, rfactor} \begin{funcdesc}{tostereo}{fragment, width, lfactor, rfactor}
Generate a stereo fragment from a mono fragment. Each pair of samples Generate a stereo fragment from a mono fragment. Each pair of samples
in the stereo fragment are computed from the mono sample, whereby left in the stereo fragment are computed from the mono sample, whereby left
channel samples are multiplied by \var{lfactor} and right channel channel samples are multiplied by \var{lfactor} and right channel
samples by \var{rfactor}. samples by \var{rfactor}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{ulaw2lin}{fragment\, width} \begin{funcdesc}{ulaw2lin}{fragment, width}
Convert sound fragments in ULAW encoding to linearly encoded sound Convert sound fragments in ULAW encoding to linearly encoded sound
fragments. ULAW encoding always uses 8 bits samples, so \var{width} fragments. ULAW encoding always uses 8 bits samples, so \var{width}
refers only to the sample width of the output fragment here. refers only to the sample width of the output fragment here.

View file

@ -157,7 +157,7 @@ followed by text composed using the \member{error_message_format}
class variable. class variable.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{send_response}{code\optional{\, message}} \begin{funcdesc}{send_response}{code\optional{, message}}
Sends a response header and logs the accepted request. The HTTP Sends a response header and logs the accepted request. The HTTP
response line is sent, followed by \emph{Server} and \emph{Date} response line is sent, followed by \emph{Server} and \emph{Date}
headers. The values for these two headers are picked up from the headers. The values for these two headers are picked up from the
@ -165,7 +165,7 @@ headers. The values for these two headers are picked up from the
respectively. respectively.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{send_header}{keyword\, value} \begin{funcdesc}{send_header}{keyword, value}
Writes a specific MIME header to the output stream. \var{keyword} Writes a specific MIME header to the output stream. \var{keyword}
should specify the header keyword, with \var{value} specifying should specify the header keyword, with \var{value} specifying
its value. its value.
@ -176,7 +176,7 @@ Sends a blank line, indicating the end of the MIME headers in
the response. the response.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{log_request}{\optional{code\optional{\, size}}} \begin{funcdesc}{log_request}{\optional{code\optional{, size}}}
Logs an accepted (successful) request. \var{code} should specify Logs an accepted (successful) request. \var{code} should specify
the numeric HTTP code associated with the response. If a size of the numeric HTTP code associated with the response. If a size of
the response is available, then it should be passed as the the response is available, then it should be passed as the

View file

@ -17,7 +17,7 @@ other, unsafe attributes.
% I've punted on the issue of documenting keyword arguments for now. % I've punted on the issue of documenting keyword arguments for now.
\begin{funcdesc}{Bastion}{object\optional{\, filter\, name\, class}} \begin{funcdesc}{Bastion}{object\optional{, filter, name, class}}
Protect the object \var{object}, returning a bastion for the Protect the object \var{object}, returning a bastion for the
object. Any attempt to access one of the object's attributes will object. Any attempt to access one of the object's attributes will
have to be approved by the \var{filter} function; if the access is have to be approved by the \var{filter} function; if the access is

View file

@ -11,14 +11,14 @@ The \code{binhex} module defines the following functions:
\setindexsubitem{(in module binhex)} \setindexsubitem{(in module binhex)}
\begin{funcdesc}{binhex}{input\, output} \begin{funcdesc}{binhex}{input, output}
Convert a binary file with filename \var{input} to binhex file Convert a binary file with filename \var{input} to binhex file
\var{output}. The \var{output} parameter can either be a filename or a \var{output}. The \var{output} parameter can either be a filename or a
file-like object (any object supporting a \var{write} and \var{close} file-like object (any object supporting a \var{write} and \var{close}
method). method).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{hexbin}{input\optional{\, output}} \begin{funcdesc}{hexbin}{input\optional{, output}}
Decode a binhex file \var{input}. \var{input} may be a filename or a Decode a binhex file \var{input}. \var{input} may be a filename or a
file-like object supporting \var{read} and \var{close} methods. file-like object supporting \var{read} and \var{close} methods.
The resulting file is written to a file named \var{output}, unless the The resulting file is written to a file named \var{output}, unless the

View file

@ -191,7 +191,7 @@ Parse a query string given as a string argument (data of type
\mimetype{application/x-www-form-urlencoded}). \mimetype{application/x-www-form-urlencoded}).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{parse_multipart}{fp\, pdict} \begin{funcdesc}{parse_multipart}{fp, pdict}
Parse input of type \mimetype{multipart/form-data} (for Parse input of type \mimetype{multipart/form-data} (for
file uploads). Arguments are \var{fp} for the input file and file uploads). Arguments are \var{fp} for the input file and
\var{pdict} for the dictionary containing other parameters of \var{pdict} for the dictionary containing other parameters of
@ -236,7 +236,7 @@ Print a list of useful (used by CGI) environment variables in
HTML. HTML.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{escape}{s\optional{\, quote}} \begin{funcdesc}{escape}{s\optional{, quote}}
Convert the characters Convert the characters
\character{\&}, \character{<} and \character{>} in string \var{s} to \character{\&}, \character{<} and \character{>} in string \var{s} to
HTML-safe sequences. Use this if you need to display text that might HTML-safe sequences. Use this if you need to display text that might

View file

@ -10,7 +10,7 @@ attempting to crack \UNIX{} passwords with a dictionary.
\index{crypt(3)} \index{crypt(3)}
\setindexsubitem{(in module crypt)} \setindexsubitem{(in module crypt)}
\begin{funcdesc}{crypt}{word\, salt} \begin{funcdesc}{crypt}{word, salt}
\var{word} will usually be a user's password. \var{salt} is a \var{word} will usually be a user's password. \var{salt} is a
2-character string which will be used to select one of 4096 variations 2-character string which will be used to select one of 4096 variations
of DES\indexii{cipher}{DES}. The characters in \var{salt} must be of DES\indexii{cipher}{DES}. The characters in \var{salt} must be

View file

@ -20,7 +20,7 @@ Raised on dbm-specific errors, such as I/O errors. \code{KeyError} is
raised for general mapping errors like specifying an incorrect key. raised for general mapping errors like specifying an incorrect key.
\end{excdesc} \end{excdesc}
\begin{funcdesc}{open}{filename\, \optional{flag\, \optional{mode}}} \begin{funcdesc}{open}{filename, \optional{flag, \optional{mode}}}
Open a dbm database and return a dbm object. The \var{filename} Open a dbm database and return a dbm object. The \var{filename}
argument is the name of the database file (without the \file{.dir} or argument is the name of the database file (without the \file{.dir} or
\file{.pag} extensions). \file{.pag} extensions).

View file

@ -49,7 +49,7 @@ traceback if none was passed. The instruction causing the exception
is indicated. is indicated.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{disassemble}{code\optional{\, lasti}} \begin{funcdesc}{disassemble}{code\optional{, lasti}}
Disassembles a code object, indicating the last instruction if \var{lasti} Disassembles a code object, indicating the last instruction if \var{lasti}
was provided. The output is divided in the following columns: was provided. The output is divided in the following columns:
\begin{itemize} \begin{itemize}
@ -65,7 +65,7 @@ variable names, constant values, branch targets, and compare
operators. operators.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{disco}{code\optional{\, lasti}} \begin{funcdesc}{disco}{code\optional{, lasti}}
A synonym for disassemble. It is more convenient to type, and kept A synonym for disassemble. It is more convenient to type, and kept
for compatibility with earlier Python releases. for compatibility with earlier Python releases.
\end{funcdesc} \end{funcdesc}

View file

@ -66,7 +66,7 @@ Add a hard line break if one does not already exist. This does not
break the logical paragraph. break the logical paragraph.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{add_hor_rule}{*args\, **kw} \begin{funcdesc}{add_hor_rule}{*args, **kw}
Insert a horizontal rule in the output. A hard break is inserted if Insert a horizontal rule in the output. A hard break is inserted if
there is data in the current paragraph, but the logical paragraph is there is data in the current paragraph, but the logical paragraph is
not broken. The arguments and keywords are passed on to the writer's not broken. The arguments and keywords are passed on to the writer's
@ -268,7 +268,7 @@ lines, or the equivelent. The \var{blankline} value will be an
integer. integer.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{send_hor_rule}{*args\, **kw} \begin{funcdesc}{send_hor_rule}{*args, **kw}
Display a horizontal rule on the output device. The arguments to this Display a horizontal rule on the output device. The arguments to this
method are entirely application- and writer-specific, and should be method are entirely application- and writer-specific, and should be
interpreted with care. The method implementation may assume that a interpreted with care. The method implementation may assume that a
@ -317,7 +317,7 @@ else. Each method simply announces itself by printing its name and
arguments on standard output. arguments on standard output.
\end{classdesc} \end{classdesc}
\begin{classdesc}{DumbWriter}{\optional{file\optional{\, maxcol\code{ = 72}}}} \begin{classdesc}{DumbWriter}{\optional{file\optional{, maxcol\code{ = 72}}}}
Simple writer class which writes output on the file object passed in Simple writer class which writes output on the file object passed in
as \var{file} or, if \var{file} is omitted, on standard output. The as \var{file} or, if \var{file} is omitted, on standard output. The
output is simply word-wrapped to the number of columns specified by output is simply word-wrapped to the number of columns specified by

View file

@ -31,14 +31,14 @@ An object representing the menubar. This object is usually not created
by the user. by the user.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{Menu}{bar\, title\optional{\, after}} \begin{funcdesc}{Menu}{bar, title\optional{, after}}
An object representing a menu. Upon creation you pass the An object representing a menu. Upon creation you pass the
\code{MenuBar} the menu appears in, the \var{title} string and a \code{MenuBar} the menu appears in, the \var{title} string and a
position (1-based) \var{after} where the menu should appear (default: position (1-based) \var{after} where the menu should appear (default:
at the end). at the end).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{MenuItem}{menu\, title\optional{\, shortcut\, callback}} \begin{funcdesc}{MenuItem}{menu, title\optional{, shortcut, callback}}
Create a menu item object. The arguments are the menu to crate the Create a menu item object. The arguments are the menu to crate the
item it, the item title string and optionally the keyboard shortcut item it, the item title string and optionally the keyboard shortcut
and a callback routine. The callback is called with the arguments and a callback routine. The callback is called with the arguments
@ -58,7 +58,7 @@ correct dimming for all menu items based on the current front window.
Add a separator to the end of a menu. Add a separator to the end of a menu.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{SubMenu}{menu\, label} \begin{funcdesc}{SubMenu}{menu, label}
Create a submenu named \var{label} under menu \var{menu}. The menu Create a submenu named \var{label} under menu \var{menu}. The menu
object is returned. object is returned.
\end{funcdesc} \end{funcdesc}
@ -72,7 +72,7 @@ which the window belongs. The window is not displayed until later.
Creates a modeless dialog window. Creates a modeless dialog window.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{windowbounds}{width\, height} \begin{funcdesc}{windowbounds}{width, height}
Return a \code{(left, top, right, bottom)} tuple suitable for creation Return a \code{(left, top, right, bottom)} tuple suitable for creation
of a window of given width and height. The window will be staggered of a window of given width and height. The window will be staggered
with respect to previous windows, and an attempt is made to keep the with respect to previous windows, and an attempt is made to keep the
@ -104,7 +104,7 @@ application. Alternatively, override the \code{do_about} method for
more elaborate about messages. more elaborate about messages.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{mainloop}{\optional{mask\, wait}} \begin{funcdesc}{mainloop}{\optional{mask, wait}}
This routine is the main event loop, call it to set your application This routine is the main event loop, call it to set your application
rolling. \var{Mask} is the mask of events you want to handle, rolling. \var{Mask} is the mask of events you want to handle,
\var{wait} is the number of ticks you want to leave to other \var{wait} is the number of ticks you want to leave to other
@ -145,7 +145,7 @@ The old on/off value is returned.
Terminate the event \code{mainloop} at the next convenient moment. Terminate the event \code{mainloop} at the next convenient moment.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_char}{c\, event} \begin{funcdesc}{do_char}{c, event}
The user typed character \var{c}. The complete details of the event The user typed character \var{c}. The complete details of the event
can be found in the \var{event} structure. This method can also be can be found in the \var{event} structure. This method can also be
provided in a \code{Window} object, which overrides the provided in a \code{Window} object, which overrides the
@ -181,22 +181,22 @@ Override this method to do any special processing on window
close. Call \code{self.do_postclose} to cleanup the parent state. close. Call \code{self.do_postclose} to cleanup the parent state.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_postresize}{width\, height\, macoswindowid} \begin{funcdesc}{do_postresize}{width, height, macoswindowid}
Called after the window is resized. Override if more needs to be done Called after the window is resized. Override if more needs to be done
than calling \code{InvalRect}. than calling \code{InvalRect}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_contentclick}{local\, modifiers\, event} \begin{funcdesc}{do_contentclick}{local, modifiers, event}
The user clicked in the content part of a window. The arguments are The user clicked in the content part of a window. The arguments are
the coordinates (window-relative), the key modifiers and the raw the coordinates (window-relative), the key modifiers and the raw
event. event.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_update}{macoswindowid\, event} \begin{funcdesc}{do_update}{macoswindowid, event}
An update event for the window was received. Redraw the window. An update event for the window was received. Redraw the window.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_activate}{activate\, event} \begin{funcdesc}{do_activate}{activate, event}
The window was activated (\code{activate==1}) or deactivated The window was activated (\code{activate==1}) or deactivated
(\code{activate==0}). Handle things like focus highlighting, etc. (\code{activate==0}). Handle things like focus highlighting, etc.
\end{funcdesc} \end{funcdesc}
@ -208,7 +208,7 @@ ControlsWindow objects have the following methods besides those of
\setindexsubitem{(ControlsWindow method)} \setindexsubitem{(ControlsWindow method)}
\begin{funcdesc}{do_controlhit}{window\, control\, pcode\, event} \begin{funcdesc}{do_controlhit}{window, control, pcode, event}
Part \code{pcode} of control \code{control} was hit by the Part \code{pcode} of control \code{control} was hit by the
user. Tracking and such has already been taken care of. user. Tracking and such has already been taken care of.
\end{funcdesc} \end{funcdesc}
@ -220,7 +220,7 @@ extra methods:
\setindexsubitem{(ScrolledWindow method)} \setindexsubitem{(ScrolledWindow method)}
\begin{funcdesc}{scrollbars}{\optional{wantx\, wanty}} \begin{funcdesc}{scrollbars}{\optional{wantx, wanty}}
Create (or destroy) horizontal and vertical scrollbars. The arguments Create (or destroy) horizontal and vertical scrollbars. The arguments
specify which you want (default: both). The scrollbars always have specify which you want (default: both). The scrollbars always have
minimum \code{0} and maximum \code{32767}. minimum \code{0} and maximum \code{32767}.
@ -238,32 +238,32 @@ Call this method when the document has changed. It will call
\code{getscrollbarvalues} and update the scrollbars. \code{getscrollbarvalues} and update the scrollbars.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{scrollbar_callback}{which\, what\, value} \begin{funcdesc}{scrollbar_callback}{which, what, value}
Supplied by you and called after user interaction. \code{Which} will Supplied by you and called after user interaction. \code{Which} will
be \code{'x'} or \code{'y'}, \code{what} will be \code{'-'}, be \code{'x'} or \code{'y'}, \code{what} will be \code{'-'},
\code{'--'}, \code{'set'}, \code{'++'} or \code{'+'}. For \code{'--'}, \code{'set'}, \code{'++'} or \code{'+'}. For
\code{'set'}, \code{value} will contain the new scrollbar position. \code{'set'}, \code{value} will contain the new scrollbar position.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{scalebarvalues}{absmin\, absmax\, curmin\, curmax} \begin{funcdesc}{scalebarvalues}{absmin, absmax, curmin, curmax}
Auxiliary method to help you calculate values to return from Auxiliary method to help you calculate values to return from
\code{getscrollbarvalues}. You pass document minimum and maximum value \code{getscrollbarvalues}. You pass document minimum and maximum value
and topmost (leftmost) and bottommost (rightmost) visible values and and topmost (leftmost) and bottommost (rightmost) visible values and
it returns the correct number or \code{None}. it returns the correct number or \code{None}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_activate}{onoff\, event} \begin{funcdesc}{do_activate}{onoff, event}
Takes care of dimming/highlighting scrollbars when a window becomes Takes care of dimming/highlighting scrollbars when a window becomes
frontmost vv. If you override this method call this one at the end of frontmost vv. If you override this method call this one at the end of
your method. your method.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_postresize}{width\, height\, window} \begin{funcdesc}{do_postresize}{width, height, window}
Moves scrollbars to the correct position. Call this method initially Moves scrollbars to the correct position. Call this method initially
if you override it. if you override it.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_controlhit}{window\, control\, pcode\, event} \begin{funcdesc}{do_controlhit}{window, control, pcode, event}
Handles scrollbar interaction. If you override it call this method Handles scrollbar interaction. If you override it call this method
first, a nonzero return value indicates the hit was in the scrollbars first, a nonzero return value indicates the hit was in the scrollbars
and has been handled. and has been handled.
@ -281,7 +281,7 @@ Create the dialog window, from the DLOG resource with id
\var{resid}. The dialog object is stored in \code{self.wid}. \var{resid}. The dialog object is stored in \code{self.wid}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_itemhit}{item\, event} \begin{funcdesc}{do_itemhit}{item, event}
Item number \var{item} was hit. You are responsible for redrawing Item number \var{item} was hit. You are responsible for redrawing
toggle buttons, etc. toggle buttons, etc.
\end{funcdesc} \end{funcdesc}

View file

@ -54,7 +54,7 @@ find the \code{eggs} variable.
complex number, its magnitude is returned. complex number, its magnitude is returned.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{apply}{function\, args\optional{, keywords}} \begin{funcdesc}{apply}{function, args\optional{, keywords}}
The \var{function} argument must be a callable object (a user-defined or The \var{function} argument must be a callable object (a user-defined or
built-in function or method, or a class object) and the \var{args} built-in function or method, or a class object) and the \var{args}
argument must be a tuple. The \var{function} is called with argument must be a tuple. The \var{function} is called with
@ -82,20 +82,20 @@ class instances are callable if they have a \method{__call__()} method.
inclusive. inclusive.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{cmp}{x\, y} \begin{funcdesc}{cmp}{x, y}
Compare the two objects \var{x} and \var{y} and return an integer Compare the two objects \var{x} and \var{y} and return an integer
according to the outcome. The return value is negative if \code{\var{x} according to the outcome. The return value is negative if \code{\var{x}
< \var{y}}, zero if \code{\var{x} == \var{y}} and strictly positive if < \var{y}}, zero if \code{\var{x} == \var{y}} and strictly positive if
\code{\var{x} > \var{y}}. \code{\var{x} > \var{y}}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{coerce}{x\, y} \begin{funcdesc}{coerce}{x, y}
Return a tuple consisting of the two numeric arguments converted to Return a tuple consisting of the two numeric arguments converted to
a common type, using the same rules as used by arithmetic a common type, using the same rules as used by arithmetic
operations. operations.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{compile}{string\, filename\, kind} \begin{funcdesc}{compile}{string, filename, kind}
Compile the \var{string} into a code object. Code objects can be Compile the \var{string} into a code object. Code objects can be
executed by an \keyword{exec} statement or evaluated by a call to executed by an \keyword{exec} statement or evaluated by a call to
\function{eval()}. The \var{filename} argument should \function{eval()}. The \var{filename} argument should
@ -117,7 +117,7 @@ class instances are callable if they have a \method{__call__()} method.
\function{long()} and \function{float()}. \function{long()} and \function{float()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{delattr}{object\, name} \begin{funcdesc}{delattr}{object, name}
This is a relative of \function{setattr()}. The arguments are an This is a relative of \function{setattr()}. The arguments are an
object and a string. The string must be the name object and a string. The string must be the name
of one of the object's attributes. The function deletes of one of the object's attributes. The function deletes
@ -146,7 +146,7 @@ class instances are callable if they have a \method{__call__()} method.
\end{verbatim} \end{verbatim}
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{divmod}{a\, b} \begin{funcdesc}{divmod}{a, b}
Take two numbers as arguments and return a pair of numbers consisting Take two numbers as arguments and return a pair of numbers consisting
of their quotient and remainder when using long division. With mixed of their quotient and remainder when using long division. With mixed
operand types, the rules for binary arithmetic operators apply. For operand types, the rules for binary arithmetic operators apply. For
@ -156,7 +156,7 @@ class instances are callable if they have a \method{__call__()} method.
\code{(math.floor(\var{a} / \var{b}), \var{a} \%{} \var{b})}. \code{(math.floor(\var{a} / \var{b}), \var{a} \%{} \var{b})}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{eval}{expression\optional{\, globals\optional{\, locals}}} \begin{funcdesc}{eval}{expression\optional{, globals\optional{, locals}}}
The arguments are a string and two optional dictionaries. The The arguments are a string and two optional dictionaries. The
\var{expression} argument is parsed and evaluated as a Python \var{expression} argument is parsed and evaluated as a Python
expression (technically speaking, a condition list) using the expression (technically speaking, a condition list) using the
@ -188,7 +188,7 @@ class instances are callable if they have a \method{__call__()} method.
\function{execfile()}. \function{execfile()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{execfile}{file\optional{\, globals\optional{\, locals}}} \begin{funcdesc}{execfile}{file\optional{, globals\optional{, locals}}}
This function is similar to the This function is similar to the
\keyword{exec} statement, but parses a file instead of a string. It \keyword{exec} statement, but parses a file instead of a string. It
is different from the \keyword{import} statement in that it does not is different from the \keyword{import} statement in that it does not
@ -206,7 +206,7 @@ class instances are callable if they have a \method{__call__()} method.
\code{None}. \code{None}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{filter}{function\, list} \begin{funcdesc}{filter}{function, list}
Construct a list from those elements of \var{list} for which Construct a list from those elements of \var{list} for which
\var{function} returns true. If \var{list} is a string or a tuple, \var{function} returns true. If \var{list} is a string or a tuple,
the result also has that type; otherwise it is always a list. If the result also has that type; otherwise it is always a list. If
@ -226,7 +226,7 @@ removed.
returned. returned.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{getattr}{object\, name} \begin{funcdesc}{getattr}{object, name}
The arguments are an object and a string. The string must be the The arguments are an object and a string. The string must be the
name of one of the object's attributes. The result is the value of name of one of the object's attributes. The result is the value of
that attribute. For example, \code{getattr(\var{x}, that attribute. For example, \code{getattr(\var{x},
@ -240,7 +240,7 @@ function or method, this is the module where it is defined, not the
module from which it is called). module from which it is called).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{hasattr}{object\, name} \begin{funcdesc}{hasattr}{object, name}
The arguments are an object and a string. The result is 1 if the The arguments are an object and a string. The result is 1 if the
string is the name of one of the object's attributes, 0 if not. string is the name of one of the object's attributes, 0 if not.
(This is implemented by calling \code{getattr(\var{object}, (This is implemented by calling \code{getattr(\var{object},
@ -355,7 +355,7 @@ desired effect.
see the description of \function{int()}. see the description of \function{int()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{map}{function\, list\, ...} \begin{funcdesc}{map}{function, list, ...}
Apply \var{function} to every item of \var{list} and return a list Apply \var{function} to every item of \var{list} and return a list
of the results. If additional \var{list} arguments are passed, of the results. If additional \var{list} arguments are passed,
\var{function} must take that many arguments and is applied to \var{function} must take that many arguments and is applied to
@ -388,7 +388,7 @@ any kind of sequence; the result is always a list.
\exception{OverflowError} exception. \exception{OverflowError} exception.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{open}{filename\optional{\, mode\optional{\, bufsize}}} \begin{funcdesc}{open}{filename\optional{, mode\optional{, bufsize}}}
Return a new file object (described earlier under Built-in Types). Return a new file object (described earlier under Built-in Types).
The first two arguments are the same as for \code{stdio}'s The first two arguments are the same as for \code{stdio}'s
\cfunction{fopen()}: \var{filename} is the file name to be opened, \cfunction{fopen()}: \var{filename} is the file name to be opened,
@ -423,7 +423,7 @@ there's no reliable way to determine whether this is the case.}
\function{chr()}. \function{chr()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{pow}{x\, y\optional{\, z}} \begin{funcdesc}{pow}{x, y\optional{, z}}
Return \var{x} to the power \var{y}; if \var{z} is present, return Return \var{x} to the power \var{y}; if \var{z} is present, return
\var{x} to the power \var{y}, modulo \var{z} (computed more \var{x} to the power \var{y}, modulo \var{z} (computed more
efficiently than \code{pow(\var{x}, \var{y}) \% \var{z}}). efficiently than \code{pow(\var{x}, \var{y}) \% \var{z}}).
@ -435,7 +435,7 @@ there's no reliable way to determine whether this is the case.}
35000)} is not allowed. 35000)} is not allowed.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{range}{\optional{start\,} stop\optional{\, step}} \begin{funcdesc}{range}{\optional{start,} stop\optional{, step}}
This is a versatile function to create lists containing arithmetic This is a versatile function to create lists containing arithmetic
progressions. It is most often used in \keyword{for} loops. The progressions. It is most often used in \keyword{for} loops. The
arguments must be plain integers. If the \var{step} argument is arguments must be plain integers. If the \var{step} argument is
@ -487,7 +487,7 @@ If the \module{readline} module was loaded, then
line editing and history features. line editing and history features.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{reduce}{function\, list\optional{\, initializer}} \begin{funcdesc}{reduce}{function, list\optional{, initializer}}
Apply the binary \var{function} to the items of \var{list} so as to Apply the binary \var{function} to the items of \var{list} so as to
reduce the list to a single value. E.g., reduce the list to a single value. E.g.,
\code{reduce(lambda x, y: x*y, \var{list}, 1)} returns the product of \code{reduce(lambda x, y: x*y, \var{list}, 1)} returns the product of
@ -551,7 +551,7 @@ to return a string that would yield an object with the same value
when passed to \function{eval()}. when passed to \function{eval()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{round}{x\, n} \begin{funcdesc}{round}{x, n}
Return the floating point value \var{x} rounded to \var{n} digits Return the floating point value \var{x} rounded to \var{n} digits
after the decimal point. If \var{n} is omitted, it defaults to zero. after the decimal point. If \var{n} is omitted, it defaults to zero.
The result is a floating point number. Values are rounded to the The result is a floating point number. Values are rounded to the
@ -560,7 +560,7 @@ when passed to \function{eval()}.
\code{round(0.5)} is \code{1.0} and \code{round(-0.5)} is \code{-1.0}). \code{round(0.5)} is \code{1.0} and \code{round(-0.5)} is \code{-1.0}).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setattr}{object\, name\, value} \begin{funcdesc}{setattr}{object, name, value}
This is the counterpart of \function{getattr()}. The arguments are an This is the counterpart of \function{getattr()}. The arguments are an
object, a string and an arbitrary value. The string must be the name object, a string and an arbitrary value. The string must be the name
of one of the object's attributes. The function assigns the value to of one of the object's attributes. The function assigns the value to
@ -569,7 +569,7 @@ when passed to \function{eval()}.
\code{\var{x}.\var{foobar} = 123}. \code{\var{x}.\var{foobar} = 123}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{slice}{\optional{start\,} stop\optional{\, step}} \begin{funcdesc}{slice}{\optional{start,} stop\optional{, step}}
Return a slice object representing the set of indices specified by Return a slice object representing the set of indices specified by
\code{range(\var{start}, \var{stop}, \var{step})}. The \var{start} \code{range(\var{start}, \var{stop}, \var{step})}. The \var{start}
and \var{step} arguments default to None. Slice objects have and \var{step} arguments default to None. Slice objects have
@ -623,7 +623,7 @@ cannot normally be affected this way, but variables retrieved from
other scopes (e.g. modules) can be. This may change.} other scopes (e.g. modules) can be. This may change.}
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{xrange}{\optional{start\,} stop\optional{\, step}} \begin{funcdesc}{xrange}{\optional{start,} stop\optional{, step}}
This function is very similar to \function{range()}, but returns an This function is very similar to \function{range()}, but returns an
``xrange object'' instead of a list. This is an opaque sequence type ``xrange object'' instead of a list. This is an opaque sequence type
which yields the same values as the corresponding list, without which yields the same values as the corresponding list, without

View file

@ -35,7 +35,7 @@ Raised on \code{gdbm}-specific errors, such as I/O errors. \code{KeyError} is
raised for general mapping errors like specifying an incorrect key. raised for general mapping errors like specifying an incorrect key.
\end{excdesc} \end{excdesc}
\begin{funcdesc}{open}{filename\, \optional{flag\, \optional{mode}}} \begin{funcdesc}{open}{filename, \optional{flag, \optional{mode}}}
Open a \code{gdbm} database and return a \code{gdbm} object. The Open a \code{gdbm} database and return a \code{gdbm} object. The
\var{filename} argument is the name of the database file. \var{filename} argument is the name of the database file.

View file

@ -119,7 +119,7 @@ Similar to
but the pairs have the point first and the normal second. but the pairs have the point first and the normal second.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{nurbssurface}{s_k\, t_k\, ctl\, s_ord\, t_ord\, type} \begin{funcdesc}{nurbssurface}{s_k, t_k, ctl, s_ord, t_ord, type}
% XXX s_k[], t_k[], ctl[][] % XXX s_k[], t_k[], ctl[][]
Defines a nurbs surface. Defines a nurbs surface.
The dimensions of The dimensions of
@ -129,13 +129,13 @@ are computed as follows:
\code{[len(\var{t_k}) - \var{t_ord}]}. \code{[len(\var{t_k}) - \var{t_ord}]}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{nurbscurve}{knots\, ctlpoints\, order\, type} \begin{funcdesc}{nurbscurve}{knots, ctlpoints, order, type}
Defines a nurbs curve. Defines a nurbs curve.
The length of ctlpoints is The length of ctlpoints is
\code{len(\var{knots}) - \var{order}}. \code{len(\var{knots}) - \var{order}}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{pwlcurve}{points\, type} \begin{funcdesc}{pwlcurve}{points, type}
Defines a piecewise-linear curve. Defines a piecewise-linear curve.
\var{points} \var{points}
is a list of points. is a list of points.

View file

@ -86,7 +86,7 @@ affects the operation of \method{handle_data()} and \method{save_end()}.
\setindexsubitem{(HTMLParser method)} \setindexsubitem{(HTMLParser method)}
\begin{funcdesc}{anchor_bgn}{href\, name\, type} \begin{funcdesc}{anchor_bgn}{href, name, type}
This method is called at the start of an anchor region. The arguments This method is called at the start of an anchor region. The arguments
correspond to the attributes of the \code{<A>} tag with the same correspond to the attributes of the \code{<A>} tag with the same
names. The default implementation maintains a list of hyperlinks names. The default implementation maintains a list of hyperlinks
@ -100,7 +100,7 @@ implementation adds a textual footnote marker using an index into the
list of hyperlinks created by \method{anchor_bgn()}. list of hyperlinks created by \method{anchor_bgn()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{handle_image}{source\, alt\optional{\, ismap\optional{\, align\optional{\, width\optional{\, height}}}}} \begin{funcdesc}{handle_image}{source, alt\optional{, ismap\optional{, align\optional{, width\optional{, height}}}}}
This method is called to handle images. The default implementation This method is called to handle images. The default implementation
simply passes the \var{alt} value to the \method{handle_data()} simply passes the \var{alt} value to the \method{handle_data()}
method. method.

View file

@ -17,7 +17,7 @@ per pixel, etc.
\end{excdesc} \end{excdesc}
\begin{funcdesc}{crop}{image\, psize\, width\, height\, x0\, y0\, x1\, y1} \begin{funcdesc}{crop}{image, psize, width, height, x0, y0, x1, y1}
Return the selected part of \var{image}, which should by Return the selected part of \var{image}, which should by
\var{width} by \var{height} in size and consist of pixels of \var{width} by \var{height} in size and consist of pixels of
\var{psize} bytes. \var{x0}, \var{y0}, \var{x1} and \var{y1} are like \var{psize} bytes. \var{x0}, \var{y0}, \var{x1} and \var{y1} are like
@ -28,14 +28,14 @@ that fall outside the old image will have their value set to zero. If
holds for the y coordinates. holds for the y coordinates.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{scale}{image\, psize\, width\, height\, newwidth\, newheight} \begin{funcdesc}{scale}{image, psize, width, height, newwidth, newheight}
Return \var{image} scaled to size \var{newwidth} by \var{newheight}. Return \var{image} scaled to size \var{newwidth} by \var{newheight}.
No interpolation is done, scaling is done by simple-minded pixel No interpolation is done, scaling is done by simple-minded pixel
duplication or removal. Therefore, computer-generated images or duplication or removal. Therefore, computer-generated images or
dithered images will not look nice after scaling. dithered images will not look nice after scaling.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{tovideo}{image\, psize\, width\, height} \begin{funcdesc}{tovideo}{image, psize, width, height}
Run a vertical low-pass filter over an image. It does so by computing Run a vertical low-pass filter over an image. It does so by computing
each destination pixel as the average of two vertically-aligned source each destination pixel as the average of two vertically-aligned source
pixels. The main use of this routine is to forestall excessive pixels. The main use of this routine is to forestall excessive
@ -43,18 +43,18 @@ flicker if the image is displayed on a video device that uses
interlacing, hence the name. interlacing, hence the name.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{grey2mono}{image\, width\, height\, threshold} \begin{funcdesc}{grey2mono}{image, width, height, threshold}
Convert a 8-bit deep greyscale image to a 1-bit deep image by Convert a 8-bit deep greyscale image to a 1-bit deep image by
tresholding all the pixels. The resulting image is tightly packed and tresholding all the pixels. The resulting image is tightly packed and
is probably only useful as an argument to \code{mono2grey}. is probably only useful as an argument to \code{mono2grey}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{dither2mono}{image\, width\, height} \begin{funcdesc}{dither2mono}{image, width, height}
Convert an 8-bit greyscale image to a 1-bit monochrome image using a Convert an 8-bit greyscale image to a 1-bit monochrome image using a
(simple-minded) dithering algorithm. (simple-minded) dithering algorithm.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{mono2grey}{image\, width\, height\, p0\, p1} \begin{funcdesc}{mono2grey}{image, width, height, p0, p1}
Convert a 1-bit monochrome image to an 8 bit greyscale or color image. Convert a 1-bit monochrome image to an 8 bit greyscale or color image.
All pixels that are zero-valued on input get value \var{p0} on output All pixels that are zero-valued on input get value \var{p0} on output
and all one-value input pixels get value \var{p1} on output. To and all one-value input pixels get value \var{p1} on output. To
@ -62,26 +62,26 @@ convert a monochrome black-and-white image to greyscale pass the
values \code{0} and \code{255} respectively. values \code{0} and \code{255} respectively.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{grey2grey4}{image\, width\, height} \begin{funcdesc}{grey2grey4}{image, width, height}
Convert an 8-bit greyscale image to a 4-bit greyscale image without Convert an 8-bit greyscale image to a 4-bit greyscale image without
dithering. dithering.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{grey2grey2}{image\, width\, height} \begin{funcdesc}{grey2grey2}{image, width, height}
Convert an 8-bit greyscale image to a 2-bit greyscale image without Convert an 8-bit greyscale image to a 2-bit greyscale image without
dithering. dithering.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{dither2grey2}{image\, width\, height} \begin{funcdesc}{dither2grey2}{image, width, height}
Convert an 8-bit greyscale image to a 2-bit greyscale image with Convert an 8-bit greyscale image to a 2-bit greyscale image with
dithering. As for \code{dither2mono}, the dithering algorithm is dithering. As for \code{dither2mono}, the dithering algorithm is
currently very simple. currently very simple.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{grey42grey}{image\, width\, height} \begin{funcdesc}{grey42grey}{image, width, height}
Convert a 4-bit greyscale image to an 8-bit greyscale image. Convert a 4-bit greyscale image to an 8-bit greyscale image.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{grey22grey}{image\, width\, height} \begin{funcdesc}{grey22grey}{image, width, height}
Convert a 2-bit greyscale image to an 8-bit greyscale image. Convert a 2-bit greyscale image to an 8-bit greyscale image.
\end{funcdesc} \end{funcdesc}

View file

@ -30,7 +30,7 @@ the string. This format is suitable to pass to \code{gl.lrectwrite},
for instance. for instance.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{readscaled}{file\, x\, y\, filter\optional{\, blur}} \begin{funcdesc}{readscaled}{file, x, y, filter\optional{, blur}}
This function is identical to read but it returns an image that is This function is identical to read but it returns an image that is
scaled to the given \var{x} and \var{y} sizes. If the \var{filter} and scaled to the given \var{x} and \var{y} sizes. If the \var{filter} and
\var{blur} parameters are omitted scaling is done by \var{blur} parameters are omitted scaling is done by
@ -55,7 +55,7 @@ compatible with SGI GL) or from top to bottom(flag is one,
compatible with X). The default is zero. compatible with X). The default is zero.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{write}{file\, data\, x\, y\, z} \begin{funcdesc}{write}{file, data, x, y, z}
This function writes the RGB or greyscale data in \var{data} to image This function writes the RGB or greyscale data in \var{data} to image
file \var{file}. \var{x} and \var{y} give the size of the image, file \var{file}. \var{x} and \var{y} give the size of the image,
\var{z} is 1 for 1 byte greyscale images or 3 for RGB images (which are \var{z} is 1 for 1 byte greyscale images or 3 for RGB images (which are

View file

@ -188,7 +188,7 @@ shared libraries is highly system dependent, and not all systems
support it.) support it.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{load_source}{name\, pathname\, file} \begin{funcdesc}{load_source}{name, pathname, file}
Load and initialize a module implemented as a Python source file and Load and initialize a module implemented as a Python source file and
return its module object. If the module was already initialized, it return its module object. If the module was already initialized, it
will be initialized \emph{again}. The \var{name} argument is used to will be initialized \emph{again}. The \var{name} argument is used to

View file

@ -17,7 +17,7 @@ Configuration Mechanism For Multimedia Mail Format Information,'' but
is not an Internet standard. However, mailcap files are supported on is not an Internet standard. However, mailcap files are supported on
most \UNIX{} systems. most \UNIX{} systems.
\begin{funcdesc}{findmatch}{caps\, MIMEtype\, key\, filename\, plist} \begin{funcdesc}{findmatch}{caps, MIMEtype, key, filename, plist}
Return a 2-tuple; the first element is a string containing the command Return a 2-tuple; the first element is a string containing the command
line to be executed line to be executed
(which can be passed to \code{os.system()}), and the second element is (which can be passed to \code{os.system()}), and the second element is

View file

@ -30,18 +30,18 @@ object \var{input} and write the decoded data to open file object
\code{'base64'}, \code{'quoted-printable'} and \code{'uuencode'}. \code{'base64'}, \code{'quoted-printable'} and \code{'uuencode'}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{encode}{input\, output\, encoding} \begin{funcdesc}{encode}{input, output, encoding}
Read data from open file object \var{input} and write it encoded using Read data from open file object \var{input} and write it encoded using
the allowed MIME \var{encoding} to open file object \var{output}. the allowed MIME \var{encoding} to open file object \var{output}.
Valid values for \var{encoding} are the same as for \method{decode()}. Valid values for \var{encoding} are the same as for \method{decode()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{copyliteral}{input\, output} \begin{funcdesc}{copyliteral}{input, output}
Read lines until \EOF{} from open file \var{input} and write them to Read lines until \EOF{} from open file \var{input} and write them to
open file \var{output}. open file \var{output}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{copybinary}{input\, output} \begin{funcdesc}{copybinary}{input, output}
Read blocks until \EOF{} from open file \var{input} and write them to Read blocks until \EOF{} from open file \var{input} and write them to
open file \var{output}. The block size is currently fixed at 8192. open file \var{output}. The block size is currently fixed at 8192.
\end{funcdesc} \end{funcdesc}

View file

@ -36,14 +36,14 @@ provide its own windows, etc.
\setindexsubitem{(AEServer method)} \setindexsubitem{(AEServer method)}
\begin{funcdesc}{installaehandler}{classe\, type\, callback} \begin{funcdesc}{installaehandler}{classe, type, callback}
Installs an AppleEvent handler. \code{Classe} and \code{type} are the Installs an AppleEvent handler. \code{Classe} and \code{type} are the
four-char OSA Class and Type designators, \code{'****'} wildcards are four-char OSA Class and Type designators, \code{'****'} wildcards are
allowed. When a matching AppleEvent is received the parameters are allowed. When a matching AppleEvent is received the parameters are
decoded and your callback is invoked. decoded and your callback is invoked.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{callback}{_object\, **kwargs} \begin{funcdesc}{callback}{_object, **kwargs}
Your callback is called with the OSA Direct Object as first positional Your callback is called with the OSA Direct Object as first positional
parameter. The other parameters are passed as keyword arguments, with parameter. The other parameters are passed as keyword arguments, with
the 4-char designator as name. Three extra keyword parameters are the 4-char designator as name. Three extra keyword parameters are

View file

@ -37,17 +37,17 @@ A number of \emph{extra} functions are defined in this module. Non
mpz-arguments are converted to mpz-values first, and the functions mpz-arguments are converted to mpz-values first, and the functions
return mpz-numbers. return mpz-numbers.
\begin{funcdesc}{powm}{base\, exponent\, modulus} \begin{funcdesc}{powm}{base, exponent, modulus}
Return \code{pow(\var{base}, \var{exponent}) \%{} \var{modulus}}. If Return \code{pow(\var{base}, \var{exponent}) \%{} \var{modulus}}. If
\code{\var{exponent} == 0}, return \code{mpz(1)}. In contrast to the \code{\var{exponent} == 0}, return \code{mpz(1)}. In contrast to the
\C-library function, this version can handle negative exponents. \C-library function, this version can handle negative exponents.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{gcd}{op1\, op2} \begin{funcdesc}{gcd}{op1, op2}
Return the greatest common divisor of \var{op1} and \var{op2}. Return the greatest common divisor of \var{op1} and \var{op2}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{gcdext}{a\, b} \begin{funcdesc}{gcdext}{a, b}
Return a tuple \code{(\var{g}, \var{s}, \var{t})}, such that Return a tuple \code{(\var{g}, \var{s}, \var{t})}, such that
\code{\var{a}*\var{s} + \var{b}*\var{t} == \var{g} == gcd(\var{a}, \var{b})}. \code{\var{a}*\var{s} + \var{b}*\var{t} == \var{g} == gcd(\var{a}, \var{b})}.
\end{funcdesc} \end{funcdesc}
@ -61,7 +61,7 @@ return mpz-numbers.
\code{\var{root}*\var{root} + \var{remainder} == \var{op}}. \code{\var{root}*\var{root} + \var{remainder} == \var{op}}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{divm}{numerator\, denominator\, modulus} \begin{funcdesc}{divm}{numerator, denominator, modulus}
Returns a number \var{q}. such that Returns a number \var{q}. such that
\code{\var{q} * \var{denominator} \%{} \var{modulus} == \var{numerator}}. \code{\var{q} * \var{denominator} \%{} \var{modulus} == \var{numerator}}.
One could also implement this function in Python, using \code{gcdext}. One could also implement this function in Python, using \code{gcdext}.

View file

@ -153,7 +153,7 @@ converted to parse trees represented as list- or tuple- trees, or may
be compiled into executable code objects. Parse trees may be be compiled into executable code objects. Parse trees may be
extracted with or without line numbering information. extracted with or without line numbering information.
\begin{funcdesc}{ast2list}{ast\optional{\, line_info\code{ = 0}}} \begin{funcdesc}{ast2list}{ast\optional{, line_info\code{ = 0}}}
This function accepts an AST object from the caller in This function accepts an AST object from the caller in
\code{\var{ast}} and returns a Python list representing the \code{\var{ast}} and returns a Python list representing the
equivelent parse tree. The resulting list representation can be used equivelent parse tree. The resulting list representation can be used
@ -172,7 +172,7 @@ the line on which the token \emph{ends}. This information is
omitted if the flag is false or omitted. omitted if the flag is false or omitted.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{ast2tuple}{ast\optional{\, line_info\code{ = 0}}} \begin{funcdesc}{ast2tuple}{ast\optional{, line_info\code{ = 0}}}
This function accepts an AST object from the caller in This function accepts an AST object from the caller in
\code{\var{ast}} and returns a Python tuple representing the \code{\var{ast}} and returns a Python tuple representing the
equivelent parse tree. Other than returning a tuple instead of a equivelent parse tree. Other than returning a tuple instead of a
@ -184,7 +184,7 @@ representing the token. This information is omitted if the flag is
false or omitted. false or omitted.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{compileast}{ast\optional{\, filename\code{ = '<ast>'}}} \begin{funcdesc}{compileast}{ast\optional{, filename\code{ = '<ast>'}}}
The Python byte compiler can be invoked on an AST object to produce The Python byte compiler can be invoked on an AST object to produce
code objects which can be used as part of an \code{exec} statement or code objects which can be used as part of an \code{exec} statement or
a call to the built-in \function{eval()}\bifuncindex{eval} function. a call to the built-in \function{eval()}\bifuncindex{eval} function.

View file

@ -69,7 +69,7 @@ NameError: spam
The module defines the following functions; each enters the debugger The module defines the following functions; each enters the debugger
in a slightly different way: in a slightly different way:
\begin{funcdesc}{run}{statement\optional{\, globals\optional{\, locals}}} \begin{funcdesc}{run}{statement\optional{, globals\optional{, locals}}}
Execute the \var{statement} (given as a string) under debugger Execute the \var{statement} (given as a string) under debugger
control. The debugger prompt appears before any code is executed; you control. The debugger prompt appears before any code is executed; you
can set breakpoints and type \code{continue}, or you can step through can set breakpoints and type \code{continue}, or you can step through
@ -81,14 +81,14 @@ the explanation of the \code{exec} statement or the \code{eval()}
built-in function.) built-in function.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{runeval}{expression\optional{\, globals\optional{\, locals}}} \begin{funcdesc}{runeval}{expression\optional{, globals\optional{, locals}}}
Evaluate the \var{expression} (given as a a string) under debugger Evaluate the \var{expression} (given as a a string) under debugger
control. When \code{runeval()} returns, it returns the value of the control. When \code{runeval()} returns, it returns the value of the
expression. Otherwise this function is similar to expression. Otherwise this function is similar to
\code{run()}. \code{run()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{runcall}{function\optional{\, argument\, ...}} \begin{funcdesc}{runcall}{function\optional{, argument, ...}}
Call the \var{function} (a function or method object, not a string) Call the \var{function} (a function or method object, not a string)
with the given arguments. When \code{runcall()} returns, it returns with the given arguments. When \code{runcall()} returns, it returns
whatever the function call returned. The debugger prompt appears as whatever the function call returned. The debugger prompt appears as

View file

@ -229,7 +229,7 @@ Collection may also become a problem here.)
Apart from the \code{Pickler} and \code{Unpickler} classes, the Apart from the \code{Pickler} and \code{Unpickler} classes, the
module defines the following functions, and an exception: module defines the following functions, and an exception:
\begin{funcdesc}{dump}{object\, file\optional{, bin}} \begin{funcdesc}{dump}{object, file\optional{, bin}}
Write a pickled representation of \var{obect} to the open file object Write a pickled representation of \var{obect} to the open file object
\var{file}. This is equivalent to \var{file}. This is equivalent to
\code{Pickler(\var{file}, \var{bin}).dump(\var{object})}. \code{Pickler(\var{file}, \var{bin}).dump(\var{object})}.

View file

@ -79,11 +79,11 @@ It defines the following functions and constants:
Change the current working directory to \var{path}. Change the current working directory to \var{path}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{chmod}{path\, mode} \begin{funcdesc}{chmod}{path, mode}
Change the mode of \var{path} to the numeric \var{mode}. Change the mode of \var{path} to the numeric \var{mode}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{chown}{path\, uid, gid} \begin{funcdesc}{chown}{path, uid, gid}
Change the owner and group id of \var{path} to the numeric \var{uid} Change the owner and group id of \var{path} to the numeric \var{uid}
and \var{gid}. and \var{gid}.
(Not on MS-DOS.) (Not on MS-DOS.)
@ -103,19 +103,19 @@ built-in function \function{open()} or by \function{popen()} or
Return a duplicate of file descriptor \var{fd}. Return a duplicate of file descriptor \var{fd}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{dup2}{fd\, fd2} \begin{funcdesc}{dup2}{fd, fd2}
Duplicate file descriptor \var{fd} to \var{fd2}, closing the latter Duplicate file descriptor \var{fd} to \var{fd2}, closing the latter
first if necessary. first if necessary.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{execv}{path\, args} \begin{funcdesc}{execv}{path, args}
Execute the executable \var{path} with argument list \var{args}, Execute the executable \var{path} with argument list \var{args},
replacing the current process (i.e., the Python interpreter). replacing the current process (i.e., the Python interpreter).
The argument list may be a tuple or list of strings. The argument list may be a tuple or list of strings.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{execve}{path\, args\, env} \begin{funcdesc}{execve}{path, args, env}
Execute the executable \var{path} with argument list \var{args}, Execute the executable \var{path} with argument list \var{args},
and environment \var{env}, and environment \var{env},
replacing the current process (i.e., the Python interpreter). replacing the current process (i.e., the Python interpreter).
@ -134,7 +134,7 @@ Note: the standard way to exit is \code{sys.exit(\var{n})}.
after a \function{fork()}. after a \function{fork()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{fdopen}{fd\optional{\, mode\optional{\, bufsize}}} \begin{funcdesc}{fdopen}{fd\optional{, mode\optional{, bufsize}}}
Return an open file object connected to the file descriptor \var{fd}. Return an open file object connected to the file descriptor \var{fd}.
The \var{mode} and \var{bufsize} arguments have the same meaning as The \var{mode} and \var{bufsize} arguments have the same meaning as
the corresponding arguments to the built-in \function{open()} function. the corresponding arguments to the built-in \function{open()} function.
@ -150,7 +150,7 @@ process id in the parent.
Return status for file descriptor \var{fd}, like \function{stat()}. Return status for file descriptor \var{fd}, like \function{stat()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{ftruncate}{fd\, length} \begin{funcdesc}{ftruncate}{fd, length}
Truncate the file corresponding to file descriptor \var{fd}, Truncate the file corresponding to file descriptor \var{fd},
so that it is at most \var{length} bytes in size. so that it is at most \var{length} bytes in size.
\end{funcdesc} \end{funcdesc}
@ -194,12 +194,12 @@ Return the current process' user id.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{kill}{pid\, sig} \begin{funcdesc}{kill}{pid, sig}
Kill the process \var{pid} with signal \var{sig}. Kill the process \var{pid} with signal \var{sig}.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{link}{src\, dst} \begin{funcdesc}{link}{src, dst}
Create a hard link pointing to \var{src} named \var{dst}. Create a hard link pointing to \var{src} named \var{dst}.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
@ -211,7 +211,7 @@ entries \code{'.'} and \code{'..'} even if they are present in the
directory. directory.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{lseek}{fd\, pos\, how} \begin{funcdesc}{lseek}{fd, pos, how}
Set the current position of file descriptor \var{fd} to position Set the current position of file descriptor \var{fd} to position
\var{pos}, modified by \var{how}: \code{0} to set the position \var{pos}, modified by \var{how}: \code{0} to set the position
relative to the beginning of the file; \code{1} to set it relative to relative to the beginning of the file; \code{1} to set it relative to
@ -224,7 +224,7 @@ Like \function{stat()}, but do not follow symbolic links. (On systems
without symbolic links, this is identical to \function{stat()}.) without symbolic links, this is identical to \function{stat()}.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{mkfifo}{path\optional{\, mode}} \begin{funcdesc}{mkfifo}{path\optional{, mode}}
Create a FIFO (a \POSIX{} named pipe) named \var{path} with numeric mode Create a FIFO (a \POSIX{} named pipe) named \var{path} with numeric mode
\var{mode}. The default \var{mode} is \code{0666} (octal). The current \var{mode}. The default \var{mode} is \code{0666} (octal). The current
umask value is first masked out from the mode. umask value is first masked out from the mode.
@ -238,7 +238,7 @@ the client opens it for writing. Note that \function{mkfifo()}
doesn't open the FIFO --- it just creates the rendezvous point. doesn't open the FIFO --- it just creates the rendezvous point.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{mkdir}{path\optional{\, mode}} \begin{funcdesc}{mkdir}{path\optional{, mode}}
Create a directory named \var{path} with numeric mode \var{mode}. Create a directory named \var{path} with numeric mode \var{mode}.
The default \var{mode} is \code{0777} (octal). On some systems, The default \var{mode} is \code{0777} (octal). On some systems,
\var{mode} is ignored. Where it is used, the current umask value is \var{mode} is ignored. Where it is used, the current umask value is
@ -250,7 +250,7 @@ Add \var{increment} to the process' ``niceness''. Return the new
niceness. (Not on MS-DOS.) niceness. (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{open}{file\, flags\optional{\, mode}} \begin{funcdesc}{open}{file, flags\optional{, mode}}
Open the file \var{file} and set various flags according to Open the file \var{file} and set various flags according to
\var{flags} and possibly its mode according to \var{mode}. \var{flags} and possibly its mode according to \var{mode}.
The default \var{mode} is \code{0777} (octal), and the current umask The default \var{mode} is \code{0777} (octal), and the current umask
@ -279,7 +279,7 @@ Lock program segments into memory. The value of \var{op}
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{popen}{command\optional{\, mode\optional{\, bufsize}}} \begin{funcdesc}{popen}{command\optional{, mode\optional{, bufsize}}}
Open a pipe to or from \var{command}. The return value is an open Open a pipe to or from \var{command}. The return value is an open
file object connected to the pipe, which can be read or written file object connected to the pipe, which can be read or written
depending on whether \var{mode} is \code{'r'} (default) or \code{'w'}. depending on whether \var{mode} is \code{'r'} (default) or \code{'w'}.
@ -291,7 +291,7 @@ object.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{putenv}{varname\, value} \begin{funcdesc}{putenv}{varname, value}
\index{environment variables!setting} \index{environment variables!setting}
Set the environment variable named \var{varname} to the string Set the environment variable named \var{varname} to the string
\var{value}. Such changes to the environment affect subprocesses \var{value}. Such changes to the environment affect subprocesses
@ -309,7 +309,7 @@ actually preferable to assign to items of \code{os.environ}.
Return the error message corresponding to the error code in \var{code}. Return the error message corresponding to the error code in \var{code}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{read}{fd\, n} \begin{funcdesc}{read}{fd, n}
Read at most \var{n} bytes from file descriptor \var{fd}. Read at most \var{n} bytes from file descriptor \var{fd}.
Return a string containing the bytes read. Return a string containing the bytes read.
@ -333,7 +333,7 @@ directory. This is identical to the \function{unlink()} function
documented below. documented below.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{rename}{src\, dst} \begin{funcdesc}{rename}{src, dst}
Rename the file or directory \var{src} to \var{dst}. Rename the file or directory \var{src} to \var{dst}.
\end{funcdesc} \end{funcdesc}
@ -353,7 +353,7 @@ Calls the system call \cfunction{setpgrp()} or \cfunction{setpgrp(0,
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setpgid}{pid\, pgrp} \begin{funcdesc}{setpgid}{pid, pgrp}
Calls the system call \cfunction{setpgid()}. See the \UNIX{} manual Calls the system call \cfunction{setpgid()}. See the \UNIX{} manual
for the semantics. for the semantics.
(Not on MS-DOS.) (Not on MS-DOS.)
@ -393,7 +393,7 @@ functions and constants that are useful for extracting information
from a stat structure. from a stat structure.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{symlink}{src\, dst} \begin{funcdesc}{symlink}{src, dst}
Create a symbolic link pointing to \var{src} named \var{dst}. (On Create a symbolic link pointing to \var{src} named \var{dst}. (On
systems without symbolic links, this always raises \exception{error}.) systems without symbolic links, this always raises \exception{error}.)
\end{funcdesc} \end{funcdesc}
@ -413,7 +413,7 @@ Return the process group associated with the terminal given by
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{tcsetpgrp}{fd\, pg} \begin{funcdesc}{tcsetpgrp}{fd, pg}
Set the process group associated with the terminal given by Set the process group associated with the terminal given by
\var{fd} (an open file descriptor as returned by \function{open()}) \var{fd} (an open file descriptor as returned by \function{open()})
to \var{pg}. to \var{pg}.
@ -453,7 +453,7 @@ Remove the file \var{path}. This is the same function as \code{remove};
the \code{unlink} name is its traditional \UNIX{} name. the \code{unlink} name is its traditional \UNIX{} name.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{utime}{path\, {\rm (}atime, mtime{\rm )}} \begin{funcdesc}{utime}{path, {\rm (}atime, mtime{\rm )}}
Set the access and modified time of the file to the given values. Set the access and modified time of the file to the given values.
(The second argument is a tuple of two items.) (The second argument is a tuple of two items.)
\end{funcdesc} \end{funcdesc}
@ -466,7 +466,7 @@ exit status (if the signal number is zero); the high bit of the low
byte is set if a core file was produced. (Not on MS-DOS.) byte is set if a core file was produced. (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{waitpid}{pid\, options} \begin{funcdesc}{waitpid}{pid, options}
Wait for completion of a child process given by proces id, and return Wait for completion of a child process given by proces id, and return
a tuple containing its pid and exit status indication (encoded as for a tuple containing its pid and exit status indication (encoded as for
\function{wait()}). The semantics of the call are affected by the \function{wait()}). The semantics of the call are affected by the
@ -476,7 +476,7 @@ normal operation. (If the system does not support
MS-DOS.) MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{write}{fd\, str} \begin{funcdesc}{write}{fd, str}
Write the string \var{str} to file descriptor \var{fd}. Write the string \var{str} to file descriptor \var{fd}.
Return the number of bytes actually written. Return the number of bytes actually written.

View file

@ -80,7 +80,7 @@ different device than \var{p}, or whether \file{\var{p}/..} and
detect mount points for all \UNIX{} and \POSIX{} variants. detect mount points for all \UNIX{} and \POSIX{} variants.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{join}{p\optional{\, q\optional{\, ...}}} \begin{funcdesc}{join}{p\optional{, q\optional{, ...}}}
Joins one or more path components intelligently. If any component is Joins one or more path components intelligently. If any component is
an absolute path, all previous components are thrown away, and joining an absolute path, all previous components are thrown away, and joining
continues. The return value is the concatenation of \var{p}, and continues. The return value is the concatenation of \var{p}, and
@ -103,7 +103,7 @@ case (use \function{normcase()} for that). On Windows, it does
converts forward slashes to backward slashes. converts forward slashes to backward slashes.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{samefile}{p\, q} \begin{funcdesc}{samefile}{p, q}
Return true if both pathname arguments refer to the same file or Return true if both pathname arguments refer to the same file or
directory (as indicated by device number and i-node number). directory (as indicated by device number and i-node number).
Raise an exception if a \function{os.stat()} call on either pathname Raise an exception if a \function{os.stat()} call on either pathname
@ -130,7 +130,7 @@ and \var{ext} is empty or begins with a period and contains
at most one period. at most one period.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{walk}{p\, visit\, arg} \begin{funcdesc}{walk}{p, visit, arg}
Calls the function \var{visit} with arguments Calls the function \var{visit} with arguments
\code{(\var{arg}, \var{dirname}, \var{names})} for each directory in the \code{(\var{arg}, \var{dirname}, \var{names})} for each directory in the
directory tree rooted at \var{p} (including \var{p} itself, if it is a directory tree rooted at \var{p} (including \var{p} itself, if it is a

View file

@ -269,7 +269,7 @@ Profiler Extensions, which includes discussion of how to derive
``better'' profilers from the classes presented, or reading the source ``better'' profilers from the classes presented, or reading the source
code for these modules. code for these modules.
\begin{funcdesc}{profile.run}{string\optional{\, filename\optional{\, ...}}} \begin{funcdesc}{profile.run}{string\optional{, filename\optional{, ...}}}
This function takes a single argument that has can be passed to the This function takes a single argument that has can be passed to the
\keyword{exec} statement, and an optional file name. In all cases this \keyword{exec} statement, and an optional file name. In all cases this
@ -338,7 +338,7 @@ Analysis of the profiler data is done using this class from the
\setindexsubitem{(in module pstats)} \setindexsubitem{(in module pstats)}
\begin{classdesc}{Stats}{filename\optional{\, ...}} \begin{classdesc}{Stats}{filename\optional{, ...}}
This class constructor creates an instance of a ``statistics object'' This class constructor creates an instance of a ``statistics object''
from a \var{filename} (or set of filenames). \class{Stats} objects are from a \var{filename} (or set of filenames). \class{Stats} objects are
manipulated by methods, in order to print useful reports. manipulated by methods, in order to print useful reports.
@ -375,7 +375,7 @@ statistics for these two entries are accumulated into a single entry.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{add}{filename\optional{\, ...}} \begin{funcdesc}{add}{filename\optional{, ...}}
This method of the \class{Stats} class accumulates additional This method of the \class{Stats} class accumulates additional
profiling information into the current profiling object. Its profiling information into the current profiling object. Its
arguments should refer to filenames created by the corresponding arguments should refer to filenames created by the corresponding
@ -384,7 +384,7 @@ version of \function{profile.run()}. Statistics for identically named
single function statistics. single function statistics.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{sort_stats}{key\optional{\, ...}} \begin{funcdesc}{sort_stats}{key\optional{, ...}}
This method modifies the \class{Stats} object by sorting it according This method modifies the \class{Stats} object by sorting it according
to the supplied criteria. The argument is typically a string to the supplied criteria. The argument is typically a string
identifying the basis of a sort (example: \code{"time"} or identifying the basis of a sort (example: \code{"time"} or
@ -441,7 +441,7 @@ now that ascending vs descending order is properly selected based on
the sort key of choice. the sort key of choice.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{print_stats}{restriction\optional{\, ...}} \begin{funcdesc}{print_stats}{restriction\optional{, ...}}
This method for the \class{Stats} class prints out a report as described This method for the \class{Stats} class prints out a report as described
in the \function{profile.run()} definition. in the \function{profile.run()} definition.
@ -476,7 +476,7 @@ and then proceed to only print the first 10\% of them.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{print_callers}{restrictions\optional{\, ...}} \begin{funcdesc}{print_callers}{restrictions\optional{, ...}}
This method for the \class{Stats} class prints a list of all functions This method for the \class{Stats} class prints a list of all functions
that called each function in the profiled database. The ordering is that called each function in the profiled database. The ordering is
identical to that provided by \method{print_stats()}, and the definition identical to that provided by \method{print_stats()}, and the definition
@ -486,7 +486,7 @@ times this specific call was made. A second non-parenthesized number
is the cumulative time spent in the function at the right. is the cumulative time spent in the function at the right.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{print_callees}{restrictions\optional{\, ...}} \begin{funcdesc}{print_callees}{restrictions\optional{, ...}}
This method for the \class{Stats} class prints a list of all function This method for the \class{Stats} class prints a list of all function
that were called by the indicated function. Aside from this reversal that were called by the indicated function. Aside from this reversal
of direction of calls (re: called vs was called by), the arguments and of direction of calls (re: called vs was called by), the arguments and

View file

@ -13,7 +13,7 @@ are many such characters, as when sending a graphics file.
\setindexsubitem{(in module quopri)} \setindexsubitem{(in module quopri)}
\begin{funcdesc}{decode}{input\, output} \begin{funcdesc}{decode}{input, output}
Decode the contents of the \var{input} file and write the resulting Decode the contents of the \var{input} file and write the resulting
decoded binary data to the \var{output} file. decoded binary data to the \var{output} file.
\var{input} and \var{output} must either be file objects or objects that \var{input} and \var{output} must either be file objects or objects that
@ -21,7 +21,7 @@ mimic the file object interface. \var{input} will be read until
\code{\var{input}.read()} returns an empty string. \code{\var{input}.read()} returns an empty string.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{encode}{input\, output\, quotetabs} \begin{funcdesc}{encode}{input, output, quotetabs}
Encode the contents of the \var{input} file and write the resulting Encode the contents of the \var{input} file and write the resulting
quoted-printable data to the \var{output} file. quoted-printable data to the \var{output} file.
\var{input} and \var{output} must either be file objects or objects that \var{input} and \var{output} must either be file objects or objects that

View file

@ -192,21 +192,21 @@ The module defines these functions, and an exception:
\setindexsubitem{(in module regex)} \setindexsubitem{(in module regex)}
\begin{funcdesc}{match}{pattern\, string} \begin{funcdesc}{match}{pattern, string}
Return how many characters at the beginning of \var{string} match Return how many characters at the beginning of \var{string} match
the regular expression \var{pattern}. Return \code{-1} if the the regular expression \var{pattern}. Return \code{-1} if the
string does not match the pattern (this is different from a string does not match the pattern (this is different from a
zero-length match!). zero-length match!).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{search}{pattern\, string} \begin{funcdesc}{search}{pattern, string}
Return the first position in \var{string} that matches the regular Return the first position in \var{string} that matches the regular
expression \var{pattern}. Return \code{-1} if no position in the string expression \var{pattern}. Return \code{-1} if no position in the string
matches the pattern (this is different from a zero-length match matches the pattern (this is different from a zero-length match
anywhere!). anywhere!).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{compile}{pattern\optional{\, translate}} \begin{funcdesc}{compile}{pattern\optional{, translate}}
Compile a regular expression pattern into a regular expression Compile a regular expression pattern into a regular expression
object, which can be used for matching using its \code{match()} and object, which can be used for matching using its \code{match()} and
\code{search()} methods, described below. The optional argument \code{search()} methods, described below. The optional argument
@ -252,7 +252,7 @@ expressions.)
Returns the current value of the syntax flags as an integer. Returns the current value of the syntax flags as an integer.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{symcomp}{pattern\optional{\, translate}} \begin{funcdesc}{symcomp}{pattern\optional{, translate}}
This is like \code{compile()}, but supports symbolic group names: if a This is like \code{compile()}, but supports symbolic group names: if a
parenthesis-enclosed group begins with a group name in angular parenthesis-enclosed group begins with a group name in angular
brackets, e.g. \code{'\e(<id>[a-z][a-z0-9]*\e)'}, the group can brackets, e.g. \code{'\e(<id>[a-z][a-z0-9]*\e)'}, the group can
@ -279,7 +279,7 @@ equivalents.
Compiled regular expression objects support these methods: Compiled regular expression objects support these methods:
\setindexsubitem{(regex method)} \setindexsubitem{(regex method)}
\begin{funcdesc}{match}{string\optional{\, pos}} \begin{funcdesc}{match}{string\optional{, pos}}
Return how many characters at the beginning of \var{string} match Return how many characters at the beginning of \var{string} match
the compiled regular expression. Return \code{-1} if the string the compiled regular expression. Return \code{-1} if the string
does not match the pattern (this is different from a zero-length does not match the pattern (this is different from a zero-length
@ -293,7 +293,7 @@ Compiled regular expression objects support these methods:
is to start. is to start.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{search}{string\optional{\, pos}} \begin{funcdesc}{search}{string\optional{, pos}}
Return the first position in \var{string} that matches the regular Return the first position in \var{string} that matches the regular
expression \code{pattern}. Return \code{-1} if no position in the expression \code{pattern}. Return \code{-1} if no position in the
string matches the pattern (this is different from a zero-length string matches the pattern (this is different from a zero-length
@ -303,7 +303,7 @@ Compiled regular expression objects support these methods:
\code{match()} method. \code{match()} method.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{group}{index\, index\, ...} \begin{funcdesc}{group}{index, index, ...}
This method is only valid when the last call to the \code{match()} This method is only valid when the last call to the \code{match()}
or \code{search()} method found a match. It returns one or more or \code{search()} method found a match. It returns one or more
groups of the match. If there is a single \var{index} argument, groups of the match. If there is a single \var{index} argument,

View file

@ -20,7 +20,7 @@ conversion help, see the URL
\setindexsubitem{(in module regsub)} \setindexsubitem{(in module regsub)}
\begin{funcdesc}{sub}{pat\, repl\, str} \begin{funcdesc}{sub}{pat, repl, str}
Replace the first occurrence of pattern \var{pat} in string Replace the first occurrence of pattern \var{pat} in string
\var{str} by replacement \var{repl}. If the pattern isn't found, \var{str} by replacement \var{repl}. If the pattern isn't found,
the string is returned unchanged. The pattern may be a string or an the string is returned unchanged. The pattern may be a string or an
@ -28,7 +28,7 @@ already compiled pattern. The replacement may contain references
\samp{\e \var{digit}} to subpatterns and escaped backslashes. \samp{\e \var{digit}} to subpatterns and escaped backslashes.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{gsub}{pat\, repl\, str} \begin{funcdesc}{gsub}{pat, repl, str}
Replace all (non-overlapping) occurrences of pattern \var{pat} in Replace all (non-overlapping) occurrences of pattern \var{pat} in
string \var{str} by replacement \var{repl}. The same rules as for string \var{str} by replacement \var{repl}. The same rules as for
\code{sub()} apply. Empty matches for the pattern are replaced only \code{sub()} apply. Empty matches for the pattern are replaced only
@ -36,7 +36,7 @@ when not adjacent to a previous match, so e.g.
\code{gsub('', '-', 'abc')} returns \code{'-a-b-c-'}. \code{gsub('', '-', 'abc')} returns \code{'-a-b-c-'}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{split}{str\, pat\optional{\, maxsplit}} \begin{funcdesc}{split}{str, pat\optional{, maxsplit}}
Split the string \var{str} in fields separated by delimiters matching Split the string \var{str} in fields separated by delimiters matching
the pattern \var{pat}, and return a list containing the fields. Only the pattern \var{pat}, and return a list containing the fields. Only
non-empty matches for the pattern are considered, so e.g. non-empty matches for the pattern are considered, so e.g.
@ -47,7 +47,7 @@ occur, and the remainder of the string is returned as the final
element of the list. element of the list.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{splitx}{str\, pat\optional{\, maxsplit}} \begin{funcdesc}{splitx}{str, pat\optional{, maxsplit}}
Split the string \var{str} in fields separated by delimiters matching Split the string \var{str} in fields separated by delimiters matching
the pattern \var{pat}, and return a list containing the fields as well the pattern \var{pat}, and return a list containing the fields as well
as the separators. For example, \code{splitx('a:::b', ':*')} returns as the separators. For example, \code{splitx('a:::b', ':*')} returns
@ -55,7 +55,7 @@ as the separators. For example, \code{splitx('a:::b', ':*')} returns
as \code{split}. as \code{split}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{capwords}{s\optional{\, pat}} \begin{funcdesc}{capwords}{s\optional{, pat}}
Capitalize words separated by optional pattern \var{pat}. The default Capitalize words separated by optional pattern \var{pat}. The default
pattern uses any characters except letters, digits and underscores as pattern uses any characters except letters, digits and underscores as
word delimiters. Capitalization is done by changing the first word delimiters. Capitalization is done by changing the first

View file

@ -151,7 +151,7 @@ Import the module \var{modulename}, raising an \exception{ImportError}
exception if the module is considered unsafe. exception if the module is considered unsafe.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{r_open}{filename\optional{\, mode\optional{\, bufsize}}} \begin{funcdesc}{r_open}{filename\optional{, mode\optional{, bufsize}}}
Method called when \function{open()} is called in the restricted Method called when \function{open()} is called in the restricted
environment. The arguments are identical to those of \function{open()}, environment. The arguments are identical to those of \function{open()},
and a file object (or a class instance compatible with file objects) and a file object (or a class instance compatible with file objects)
@ -172,7 +172,7 @@ restricted environment's \code{sys.modules} dictionary).
And their equivalents with access to restricted standard I/O streams: And their equivalents with access to restricted standard I/O streams:
\begin{funcdesc}{s_import}{modulename\optional{\, globals, locals, fromlist}} \begin{funcdesc}{s_import}{modulename\optional{, globals, locals, fromlist}}
Import the module \var{modulename}, raising an \exception{ImportError} Import the module \var{modulename}, raising an \exception{ImportError}
exception if the module is considered unsafe. exception if the module is considered unsafe.
\end{funcdesc} \end{funcdesc}

View file

@ -29,7 +29,7 @@ the string. This format is suitable to pass to \code{gl.lrectwrite},
for instance. for instance.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{longstoimage}{data\, x\, y\, z\, file} \begin{funcdesc}{longstoimage}{data, x, y, z, file}
This function writes the RGBA data in \var{data} to image This function writes the RGBA data in \var{data} to image
file \var{file}. \var{x} and \var{y} give the size of the image. file \var{file}. \var{x} and \var{y} give the size of the image.
\var{z} is 1 if the saved image should be 1 byte greyscale, 3 if the \var{z} is 1 if the saved image should be 1 byte greyscale, 3 if the

View file

@ -25,7 +25,7 @@ order.
The available functions in this module are: The available functions in this module are:
\setindexsubitem{(in module rotor)} \setindexsubitem{(in module rotor)}
\begin{funcdesc}{newrotor}{key\optional{\, numrotors}} \begin{funcdesc}{newrotor}{key\optional{, numrotors}}
Return a rotor object. \var{key} is a string containing the encryption key Return a rotor object. \var{key} is a string containing the encryption key
for the object; it can contain arbitrary binary data. The key will be used for the object; it can contain arbitrary binary data. The key will be used
to randomly generate the rotor permutations and their initial positions. to randomly generate the rotor permutations and their initial positions.

View file

@ -13,7 +13,7 @@ corresponding string, as would be printed by the C function
\code{perror()}. \code{perror()}.
\end{excdesc} \end{excdesc}
\begin{funcdesc}{select}{iwtd\, owtd\, ewtd\optional{\, timeout}} \begin{funcdesc}{select}{iwtd, owtd, ewtd\optional{, timeout}}
This is a straightforward interface to the \UNIX{} \code{select()} This is a straightforward interface to the \UNIX{} \code{select()}
system call. The first three arguments are lists of `waitable system call. The first three arguments are lists of `waitable
objects': either integers representing \UNIX{} file descriptors or objects': either integers representing \UNIX{} file descriptors or

View file

@ -140,7 +140,7 @@ This method is called when an end tag is found which does not
correspond to any open element. correspond to any open element.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{unknown_starttag}{tag\, attributes} \begin{funcdesc}{unknown_starttag}{tag, attributes}
This method is called to process an unknown start tag. It is intended This method is called to process an unknown start tag. It is intended
to be overridden by a derived class; the base class implementation to be overridden by a derived class; the base class implementation
does nothing. does nothing.

View file

@ -124,7 +124,7 @@ The \module{signal} module defines the following functions:
\UNIX{} man page \manpage{signal}{2}.) \UNIX{} man page \manpage{signal}{2}.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{signal}{signalnum\, handler} \begin{funcdesc}{signal}{signalnum, handler}
Set the handler for signal \var{signalnum} to the function Set the handler for signal \var{signalnum} to the function
\var{handler}. \var{handler} can be any callable Python object, or \var{handler}. \var{handler} can be any callable Python object, or
one of the special values \constant{signal.SIG_IGN} or one of the special values \constant{signal.SIG_IGN} or

View file

@ -260,7 +260,7 @@ specifies the maximum number of queued connections and should be at
least 1; the maximum value is system-dependent (usually 5). least 1; the maximum value is system-dependent (usually 5).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{makefile}{\optional{mode\optional{\, bufsize}}} \begin{funcdesc}{makefile}{\optional{mode\optional{, bufsize}}}
Return a \dfn{file object} associated with the socket. (File objects Return a \dfn{file object} associated with the socket. (File objects
were described earlier in \ref{bltin-file-objects}, ``File Objects.'') were described earlier in \ref{bltin-file-objects}, ``File Objects.'')
The file object references a \cfunction{dup()}ped version of the The file object references a \cfunction{dup()}ped version of the
@ -293,7 +293,7 @@ socket. The optional \var{flags} argument has the same meaning as for
\method{recv()} above. Returns the number of bytes sent. \method{recv()} above. Returns the number of bytes sent.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{sendto}{string\optional{\, flags}\, address} \begin{funcdesc}{sendto}{string\optional{, flags}, address}
Send data to the socket. The socket should not be connected to a Send data to the socket. The socket should not be connected to a
remote socket, since the destination socket is specified by remote socket, since the destination socket is specified by
\var{address}. The optional \var{flags} argument has the same \var{address}. The optional \var{flags} argument has the same
@ -310,7 +310,7 @@ immediately dispose of the data, a \exception{error} exception is
raised; in blocking mode, the calls block until they can proceed. raised; in blocking mode, the calls block until they can proceed.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setsockopt}{level\, optname\, value} \begin{funcdesc}{setsockopt}{level, optname, value}
Set the value of the given socket option (see the \UNIX{} man page Set the value of the given socket option (see the \UNIX{} man page
\manpage{setsockopt}{2}). The needed symbolic constants are defined in \manpage{setsockopt}{2}). The needed symbolic constants are defined in
the \module{socket} module (\code{SO_*} etc.). The value can be an the \module{socket} module (\code{SO_*} etc.). The value can be an

View file

@ -123,14 +123,14 @@ the \emph{new} socket object to be used to communicate with the
client, and the client's address. client, and the client's address.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{handle_error}{request\, client_address} \begin{funcdesc}{handle_error}{request, client_address}
This function is called if the \member{RequestHandlerClass}'s This function is called if the \member{RequestHandlerClass}'s
\method{handle()} method raises an exception. The default action is \method{handle()} method raises an exception. The default action is
to print the traceback to standard output and continue handling to print the traceback to standard output and continue handling
further requests. further requests.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{process_request}{request\, client_address} \begin{funcdesc}{process_request}{request, client_address}
Calls \method{finish_request()} to create an instance of the Calls \method{finish_request()} to create an instance of the
\member{RequestHandlerClass}. If desired, this function can create a \member{RequestHandlerClass}. If desired, this function can create a
new process or thread to handle the request; the \class{ForkingMixIn} new process or thread to handle the request; the \class{ForkingMixIn}
@ -151,7 +151,7 @@ Called by the server's constructor to bind the socket to the desired
address. May be overridden. address. May be overridden.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{verify_request}{request\, client_address} \begin{funcdesc}{verify_request}{request, client_address}
Must return a Boolean value; if the value is true, the request will be Must return a Boolean value; if the value is true, the request will be
processed, and if it's false, the request will be denied. processed, and if it's false, the request will be denied.
This function can be overridden to implement access controls for a server. This function can be overridden to implement access controls for a server.

View file

@ -80,16 +80,16 @@ matches any single character.
On the Macintosh this function currently returns an empty list. On the Macintosh this function currently returns an empty list.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setdefscrollbars}{hflag\, vflag} \begin{funcdesc}{setdefscrollbars}{hflag, vflag}
Set the flags controlling whether subsequently opened windows will Set the flags controlling whether subsequently opened windows will
have horizontal and/or vertical scroll bars. have horizontal and/or vertical scroll bars.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setdefwinpos}{h\, v} \begin{funcdesc}{setdefwinpos}{h, v}
Set the default window position for windows opened subsequently. Set the default window position for windows opened subsequently.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setdefwinsize}{width\, height} \begin{funcdesc}{setdefwinsize}{width, height}
Set the default window size for windows opened subsequently. Set the default window size for windows opened subsequently.
\end{funcdesc} \end{funcdesc}
@ -176,7 +176,7 @@ Note: normally, menus are created locally; see the window method
returned by this call exists. returned by this call exists.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{newbitmap}{width\, height} \begin{funcdesc}{newbitmap}{width, height}
Create a new bitmap object of the given dimensions. Create a new bitmap object of the given dimensions.
Methods of bitmap objects are described below. Methods of bitmap objects are described below.
Not available on the Macintosh. Not available on the Macintosh.
@ -192,7 +192,7 @@ Display a dialog box containing the string.
The user must click OK before the function returns. The user must click OK before the function returns.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{askync}{prompt\, default} \begin{funcdesc}{askync}{prompt, default}
Display a dialog that prompts the user to answer a question with yes or Display a dialog that prompts the user to answer a question with yes or
no. no.
Return 0 for no, 1 for yes. Return 0 for no, 1 for yes.
@ -203,7 +203,7 @@ If the user cancels the dialog, the
exception is raised. exception is raised.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{askstr}{prompt\, default} \begin{funcdesc}{askstr}{prompt, default}
Display a dialog that prompts the user for a string. Display a dialog that prompts the user for a string.
If the user hits the Return key, the default string is returned. If the user hits the Return key, the default string is returned.
If the user cancels the dialog, the If the user cancels the dialog, the
@ -211,7 +211,7 @@ If the user cancels the dialog, the
exception is raised. exception is raised.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{askfile}{prompt\, default\, new} \begin{funcdesc}{askfile}{prompt, default, new}
Ask the user to specify a filename. Ask the user to specify a filename.
If If
\var{new} \var{new}
@ -221,7 +221,7 @@ If the user cancels the dialog, the
exception is raised. exception is raised.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setcutbuffer}{i\, string} \begin{funcdesc}{setcutbuffer}{i, string}
Store the string in the system's cut buffer number Store the string in the system's cut buffer number
\var{i}, \var{i},
where it can be found (for pasting) by other applications. where it can be found (for pasting) by other applications.
@ -278,7 +278,7 @@ characters).
Return the total line height of the current font. Return the total line height of the current font.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{textbreak}{str\, width} \begin{funcdesc}{textbreak}{str, width}
Return the number of characters of the string that fit into a space of Return the number of characters of the string that fit into a space of
\var{width} \var{width}
bits wide when drawn in the curent font. bits wide when drawn in the curent font.
@ -365,7 +365,7 @@ Methods of menu objects are described below.
returned by this call exists. returned by this call exists.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{scroll}{rect\, point} \begin{funcdesc}{scroll}{rect, point}
Scroll the given rectangle by the vector given by the point. Scroll the given rectangle by the vector given by the point.
\end{funcdesc} \end{funcdesc}
@ -378,7 +378,7 @@ Move the origin of the window (its upper left corner)
to the given point in the document. to the given point in the document.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setselection}{i\, str} \begin{funcdesc}{setselection}{i, str}
Attempt to set X11 selection number Attempt to set X11 selection number
\var{i} \var{i}
to the string to the string
@ -428,12 +428,12 @@ On X11, there are many more (see
\end{sloppypar} \end{sloppypar}
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setwinpos}{h\, v} \begin{funcdesc}{setwinpos}{h, v}
Set the the position of the window's upper left corner (relative to Set the the position of the window's upper left corner (relative to
the upper left corner of the screen). the upper left corner of the screen).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setwinsize}{width\, height} \begin{funcdesc}{setwinsize}{width, height}
Set the window's size. Set the window's size.
\end{funcdesc} \end{funcdesc}
@ -474,11 +474,11 @@ Drawing objects have the following methods:
Draw a box just inside a rectangle. Draw a box just inside a rectangle.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{circle}{center\, radius} \begin{funcdesc}{circle}{center, radius}
Draw a circle with given center point and radius. Draw a circle with given center point and radius.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{elarc}{center\, \(rh\, rv\)\, \(a1\, a2\)} \begin{funcdesc}{elarc}{center, \(rh, rv\), \(a1, a2\)}
Draw an elliptical arc with given center point. Draw an elliptical arc with given center point.
\code{(\var{rh}, \var{rv})} \code{(\var{rh}, \var{rv})}
gives the half sizes of the horizontal and vertical radii. gives the half sizes of the horizontal and vertical radii.
@ -491,11 +491,11 @@ gives the angles (in degrees) of the begin and end points.
Erase a rectangle. Erase a rectangle.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{fillcircle}{center\, radius} \begin{funcdesc}{fillcircle}{center, radius}
Draw a filled circle with given center point and radius. Draw a filled circle with given center point and radius.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{fillelarc}{center\, \(rh\, rv\)\, \(a1\, a2\)} \begin{funcdesc}{fillelarc}{center, \(rh, rv\), \(a1, a2\)}
Draw a filled elliptical arc; arguments as for \code{elarc}. Draw a filled elliptical arc; arguments as for \code{elarc}.
\end{funcdesc} \end{funcdesc}
@ -507,7 +507,7 @@ Draw a filled polygon given by a list (or tuple) of points.
Invert a rectangle. Invert a rectangle.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{line}{p1\, p2} \begin{funcdesc}{line}{p1, p2}
Draw a line from point Draw a line from point
\var{p1} \var{p1}
to to
@ -522,20 +522,20 @@ Fill a rectangle.
Draw the lines connecting the given list (or tuple) of points. Draw the lines connecting the given list (or tuple) of points.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{shade}{rect\, percent} \begin{funcdesc}{shade}{rect, percent}
Fill a rectangle with a shading pattern that is about Fill a rectangle with a shading pattern that is about
\var{percent} \var{percent}
percent filled. percent filled.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{text}{p\, str} \begin{funcdesc}{text}{p, str}
Draw a string starting at point p (the point specifies the Draw a string starting at point p (the point specifies the
top left coordinate of the string). top left coordinate of the string).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{xorcircle}{center\, radius} \begin{funcdesc}{xorcircle}{center, radius}
\funcline{xorelarc}{center\, \(rh\, rv\)\, \(a1\, a2\)} \funcline{xorelarc}{center, \(rh, rv\), \(a1, a2\)}
\funcline{xorline}{p1\, p2} \funcline{xorline}{p1, p2}
\funcline{xorpoly}{points} \funcline{xorpoly}{points}
Draw a circle, an elliptical arc, a line or a polygon, respectively, Draw a circle, an elliptical arc, a line or a polygon, respectively,
in XOR mode. in XOR mode.
@ -570,7 +570,7 @@ default font, which is in turn initialized from the global default
font when the window is created. font when the window is created.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{bitmap}{point\, bitmap\, mask} \begin{funcdesc}{bitmap}{point, bitmap, mask}
Draw the \var{bitmap} with its top left corner at \var{point}. Draw the \var{bitmap} with its top left corner at \var{point}.
If the optional \var{mask} argument is present, it should be either If the optional \var{mask} argument is present, it should be either
the same object as \var{bitmap}, to draw only those bits that are set the same object as \var{bitmap}, to draw only those bits that are set
@ -608,23 +608,23 @@ The following methods are defined:
\setindexsubitem{(menu method)} \setindexsubitem{(menu method)}
\begin{funcdesc}{additem}{text\, shortcut} \begin{funcdesc}{additem}{text, shortcut}
Add a menu item with given text. Add a menu item with given text.
The shortcut must be a string of length 1, or omitted (to specify no The shortcut must be a string of length 1, or omitted (to specify no
shortcut). shortcut).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setitem}{i\, text} \begin{funcdesc}{setitem}{i, text}
Set the text of item number Set the text of item number
\var{i}. \var{i}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{enable}{i\, flag} \begin{funcdesc}{enable}{i, flag}
Enable or disables item Enable or disables item
\var{i}. \var{i}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{check}{i\, flag} \begin{funcdesc}{check}{i, flag}
Set or clear the Set or clear the
\dfn{check mark} \dfn{check mark}
for item for item
@ -652,7 +652,7 @@ Return a tuple representing the width and height of the bitmap.
function.) function.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setbit}{point\, bit} \begin{funcdesc}{setbit}{point, bit}
Set the value of the bit indicated by \var{point} to \var{bit}. Set the value of the bit indicated by \var{point} to \var{bit}.
\end{funcdesc} \end{funcdesc}
@ -691,7 +691,7 @@ Pass a draw event to the text-edit block.
The rectangle specifies the redraw area. The rectangle specifies the redraw area.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{event}{type\, window\, detail} \begin{funcdesc}{event}{type, window, detail}
Pass an event gotten from Pass an event gotten from
\code{stdwin.getevent()} \code{stdwin.getevent()}
to the text-edit block. to the text-edit block.
@ -727,7 +727,7 @@ Replace the text in the focus by the given string.
The new focus is an insert point at the end of the string. The new focus is an insert point at the end of the string.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setfocus}{i\, j} \begin{funcdesc}{setfocus}{i, j}
Specify the new focus. Specify the new focus.
Out-of-bounds values are silently clipped. Out-of-bounds values are silently clipped.
\end{funcdesc} \end{funcdesc}
@ -869,7 +869,7 @@ Returns
if the list is empty or all its rectangles are empty. if the list is empty or all its rectangles are empty.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{pointinrect}{point\, rect} \begin{funcdesc}{pointinrect}{point, rect}
Returns true if the point is inside the rectangle. Returns true if the point is inside the rectangle.
By definition, a point By definition, a point
\code{(\var{h}, \var{v})} \code{(\var{h}, \var{v})}
@ -884,7 +884,7 @@ $\var{top} \leq \var{v} < \var{bottom}$.
\fi \fi
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{inset}{rect\, \(dh\, dv\)} \begin{funcdesc}{inset}{rect, \(dh, dv\)}
Returns a rectangle that lies inside the Returns a rectangle that lies inside the
\code{rect} \code{rect}
argument by argument by

View file

@ -1,12 +1,11 @@
\section{Standard Module \sectcode{string}} \section{Standard Module \sectcode{string}}
\label{module-string} \label{module-string}
\stmodindex{string} \stmodindex{string}
This module defines some constants useful for checking character This module defines some constants useful for checking character
classes and some useful string functions. See the module classes and some useful string functions. See the module
\code{re} for string functions based on regular expressions. \module{re}\refstmodindex{re} for string functions based on regular
\refstmodindex{re} expressions.
The constants defined in this module are are: The constants defined in this module are are:
@ -20,16 +19,16 @@ The constants defined in this module are are:
\end{datadesc} \end{datadesc}
\begin{datadesc}{letters} \begin{datadesc}{letters}
The concatenation of the strings \code{lowercase} and The concatenation of the strings \function{lowercase()} and
\code{uppercase} described below. \function{uppercase()} described below.
\end{datadesc} \end{datadesc}
\begin{datadesc}{lowercase} \begin{datadesc}{lowercase}
A string containing all the characters that are considered lowercase A string containing all the characters that are considered lowercase
letters. On most systems this is the string letters. On most systems this is the string
\code{'abcdefghijklmnopqrstuvwxyz'}. Do not change its definition --- \code{'abcdefghijklmnopqrstuvwxyz'}. Do not change its definition ---
the effect on the routines \code{upper} and \code{swapcase} is the effect on the routines \function{upper()} and
undefined. \function{swapcase()} is undefined.
\end{datadesc} \end{datadesc}
\begin{datadesc}{octdigits} \begin{datadesc}{octdigits}
@ -40,16 +39,16 @@ The constants defined in this module are are:
A string containing all the characters that are considered uppercase A string containing all the characters that are considered uppercase
letters. On most systems this is the string letters. On most systems this is the string
\code{'ABCDEFGHIJKLMNOPQRSTUVWXYZ'}. Do not change its definition --- \code{'ABCDEFGHIJKLMNOPQRSTUVWXYZ'}. Do not change its definition ---
the effect on the routines \code{lower} and \code{swapcase} is the effect on the routines \function{lower()} and
undefined. \function{swapcase()} is undefined.
\end{datadesc} \end{datadesc}
\begin{datadesc}{whitespace} \begin{datadesc}{whitespace}
A string containing all characters that are considered whitespace. A string containing all characters that are considered whitespace.
On most systems this includes the characters space, tab, linefeed, On most systems this includes the characters space, tab, linefeed,
return, formfeed, and vertical tab. Do not change its definition --- return, formfeed, and vertical tab. Do not change its definition ---
the effect on the routines \code{strip} and \code{split} is the effect on the routines \function{strip()} and \function{split()}
undefined. is undefined.
\end{datadesc} \end{datadesc}
The functions defined in this module are: The functions defined in this module are:
@ -60,10 +59,11 @@ The functions defined in this module are:
Convert a string to a floating point number. The string must have Convert a string to a floating point number. The string must have
the standard syntax for a floating point literal in Python, optionally the standard syntax for a floating point literal in Python, optionally
preceded by a sign (\samp{+} or \samp{-}). Note that this behaves preceded by a sign (\samp{+} or \samp{-}). Note that this behaves
identical to the built-in function \code{float()} when passed a string. identical to the built-in function
\function{float()}\bifuncindex{float} when passed a string.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{atoi}{s\optional{\, base}} \begin{funcdesc}{atoi}{s\optional{, base}}
Convert string \var{s} to an integer in the given \var{base}. The Convert string \var{s} to an integer in the given \var{base}. The
string must consist of one or more digits, optionally preceded by a string must consist of one or more digits, optionally preceded by a
sign (\samp{+} or \samp{-}). The \var{base} defaults to 10. If it is sign (\samp{+} or \samp{-}). The \var{base} defaults to 10. If it is
@ -72,20 +72,20 @@ string (after stripping the sign): \samp{0x} or \samp{0X} means 16,
\samp{0} means 8, anything else means 10. If \var{base} is 16, a \samp{0} means 8, anything else means 10. If \var{base} is 16, a
leading \samp{0x} or \samp{0X} is always accepted. Note that when leading \samp{0x} or \samp{0X} is always accepted. Note that when
invoked without \var{base} or with \var{base} set to 10, this behaves invoked without \var{base} or with \var{base} set to 10, this behaves
identical to the built-in function \code{int()} when passed a string. identical to the built-in function \function{int()} when passed a string.
(Also note: for a more flexible interpretation of numeric literals, (Also note: for a more flexible interpretation of numeric literals,
use the built-in function \code{eval()}.) use the built-in function \function{eval()}\bifuncindex{eval}.)
\bifuncindex{eval}
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{atol}{s\optional{\, base}} \begin{funcdesc}{atol}{s\optional{, base}}
Convert string \var{s} to a long integer in the given \var{base}. The Convert string \var{s} to a long integer in the given \var{base}. The
string must consist of one or more digits, optionally preceded by a string must consist of one or more digits, optionally preceded by a
sign (\samp{+} or \samp{-}). The \var{base} argument has the same sign (\samp{+} or \samp{-}). The \var{base} argument has the same
meaning as for \code{atoi()}. A trailing \samp{l} or \samp{L} is not meaning as for \function{atoi()}. A trailing \samp{l} or \samp{L} is
allowed, except if the base is 0. Note that when invoked without not allowed, except if the base is 0. Note that when invoked without
\var{base} or with \var{base} set to 10, this behaves identical to the \var{base} or with \var{base} set to 10, this behaves identical to the
built-in function \code{long()} when passed a string. built-in function \function{long()}\bifuncindex{long} when passed a
string.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{capitalize}{word} \begin{funcdesc}{capitalize}{word}
@ -93,13 +93,14 @@ Capitalize the first character of the argument.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{capwords}{s} \begin{funcdesc}{capwords}{s}
Split the argument into words using \code{split}, capitalize each word Split the argument into words using \function{split()}, capitalize
using \code{capitalize}, and join the capitalized words using each word using \function{capitalize()}, and join the capitalized
\code{join}. Note that this replaces runs of whitespace characters by words using \function{join()}. Note that this replaces runs of
a single space, and removes leading and trailing whitespace. whitespace characters by a single space, and removes leading and
trailing whitespace.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{expandtabs}{s\, tabsize} \begin{funcdesc}{expandtabs}{s, tabsize}
Expand tabs in a string, i.e.\ replace them by one or more spaces, Expand tabs in a string, i.e.\ replace them by one or more spaces,
depending on the current column and the given tab size. The column depending on the current column and the given tab size. The column
number is reset to zero after each newline occurring in the string. number is reset to zero after each newline occurring in the string.
@ -107,29 +108,29 @@ This doesn't understand other non-printing characters or escape
sequences. sequences.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{find}{s\, sub\optional{\, start\optional{\,end}}} \begin{funcdesc}{find}{s, sub\optional{, start\optional{,end}}}
Return the lowest index in \var{s} where the substring \var{sub} is Return the lowest index in \var{s} where the substring \var{sub} is
found such that \var{sub} is wholly contained in found such that \var{sub} is wholly contained in
\code{\var{s}[\var{start}:\var{end}]}. Return -1 on failure. \code{\var{s}[\var{start}:\var{end}]}. Return \code{-1} on failure.
Defaults for \var{start} and \var{end} and interpretation of negative Defaults for \var{start} and \var{end} and interpretation of negative
values is the same as for slices. values is the same as for slices.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{rfind}{s\, sub\optional{\, start\optional{\,end}}} \begin{funcdesc}{rfind}{s, sub\optional{, start\optional{, end}}}
Like \code{find} but find the highest index. Like \function{find()} but find the highest index.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{index}{s\, sub\optional{\, start\optional{\,end}}} \begin{funcdesc}{index}{s, sub\optional{, start\optional{, end}}}
Like \code{find} but raise \code{ValueError} when the substring is Like \function{find()} but raise \exception{ValueError} when the
not found. substring is not found.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{rindex}{s\, sub\optional{\, start\optional{\,end}}} \begin{funcdesc}{rindex}{s, sub\optional{, start\optional{, end}}}
Like \code{rfind} but raise \code{ValueError} when the substring is Like \function{rfind()} but raise \exception{ValueError} when the
not found. substring is not found.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{count}{s\, sub\optional{\, start\optional{\,end}}} \begin{funcdesc}{count}{s, sub\optional{, start\optional{, end}}}
Return the number of (non-overlapping) occurrences of substring Return the number of (non-overlapping) occurrences of substring
\var{sub} in string \code{\var{s}[\var{start}:\var{end}]}. \var{sub} in string \code{\var{s}[\var{start}:\var{end}]}.
Defaults for \var{start} and \var{end} and interpretation of negative Defaults for \var{start} and \var{end} and interpretation of negative
@ -141,13 +142,13 @@ Convert letters to lower case.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{maketrans}{from, to} \begin{funcdesc}{maketrans}{from, to}
Return a translation table suitable for passing to \code{string.translate} Return a translation table suitable for passing to
or \code{regex.compile}, that will map each character in \var{from} \function{translate()} or \function{regex.compile()}, that will map
into the character at the same position in \var{to}; \var{from} and each character in \var{from} into the character at the same position
\var{to} must have the same length. in \var{to}; \var{from} and \var{to} must have the same length.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{split}{s\optional{\, sep\optional{\, maxsplit}}} \begin{funcdesc}{split}{s\optional{, sep\optional{, maxsplit}}}
Return a list of the words of the string \var{s}. If the optional Return a list of the words of the string \var{s}. If the optional
second argument \var{sep} is absent or \code{None}, the words are second argument \var{sep} is absent or \code{None}, the words are
separated by arbitrary strings of whitespace characters (space, tab, separated by arbitrary strings of whitespace characters (space, tab,
@ -161,24 +162,24 @@ remainder of the string is returned as the final element of the list
(thus, the list will have at most \code{\var{maxsplit}+1} elements). (thus, the list will have at most \code{\var{maxsplit}+1} elements).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{splitfields}{s\optional{\, sep\optional{\, maxsplit}}} \begin{funcdesc}{splitfields}{s\optional{, sep\optional{, maxsplit}}}
This function behaves identically to \code{split}. (In the past, This function behaves identically to \function{split()}. (In the
\code{split} was only used with one argument, while \code{splitfields} past, \function{split()} was only used with one argument, while
was only used with two arguments.) \function{splitfields()} was only used with two arguments.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{join}{words\optional{\, sep}} \begin{funcdesc}{join}{words\optional{, sep}}
Concatenate a list or tuple of words with intervening occurrences of Concatenate a list or tuple of words with intervening occurrences of
\var{sep}. The default value for \var{sep} is a single space character. \var{sep}. The default value for \var{sep} is a single space
It is always true that character. It is always true that
\code{string.join(string.split(\var{s}, \var{sep}), \var{sep})} \samp{string.join(string.split(\var{s}, \var{sep}), \var{sep})}
equals \var{s}. equals \var{s}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{joinfields}{words\optional{\, sep}} \begin{funcdesc}{joinfields}{words\optional{, sep}}
This function behaves identical to \code{join}. (In the past, This function behaves identical to \function{join()}. (In the past,
\code{join} was only used with one argument, while \code{joinfields} \function{join()} was only used with one argument, while
was only used with two arguments.) \function{joinfields()} was only used with two arguments.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{lstrip}{s} \begin{funcdesc}{lstrip}{s}
@ -198,19 +199,19 @@ Convert lower case letters to upper case and vice versa.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{translate}{s, table\optional{, deletechars}} \begin{funcdesc}{translate}{s, table\optional{, deletechars}}
Delete all characters from \var{s} that are in \var{deletechars} (if present), and Delete all characters from \var{s} that are in \var{deletechars} (if
then translate the characters using \var{table}, which must be present), and then translate the characters using \var{table}, which
a 256-character string giving the translation for each character must be a 256-character string giving the translation for each
value, indexed by its ordinal. character value, indexed by its ordinal.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{upper}{s} \begin{funcdesc}{upper}{s}
Convert letters to upper case. Convert letters to upper case.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{ljust}{s\, width} \begin{funcdesc}{ljust}{s, width}
\funcline{rjust}{s\, width} \funcline{rjust}{s, width}
\funcline{center}{s\, width} \funcline{center}{s, width}
These functions respectively left-justify, right-justify and center a These functions respectively left-justify, right-justify and center a
string in a field of given width. string in a field of given width.
They return a string that is at least They return a string that is at least
@ -221,7 +222,7 @@ with spaces until the given width on the right, left or both sides.
The string is never truncated. The string is never truncated.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{zfill}{s\, width} \begin{funcdesc}{zfill}{s, width}
Pad a numeric string on the left with zero digits until the given Pad a numeric string on the left with zero digits until the given
width is reached. Strings starting with a sign are handled correctly. width is reached. Strings starting with a sign are handled correctly.
\end{funcdesc} \end{funcdesc}
@ -234,10 +235,10 @@ replaced.
\end{funcdesc} \end{funcdesc}
This module is implemented in Python. Much of its functionality has This module is implemented in Python. Much of its functionality has
been reimplemented in the built-in module \code{strop}. However, you been reimplemented in the built-in module
\module{strop}\refbimodindex{strop}. However, you
should \emph{never} import the latter module directly. When should \emph{never} import the latter module directly. When
\code{string} discovers that \code{strop} exists, it transparently \module{string} discovers that \module{strop} exists, it transparently
replaces parts of itself with the implementation from \code{strop}. replaces parts of itself with the implementation from \module{strop}.
After initialization, there is \emph{no} overhead in using After initialization, there is \emph{no} overhead in using
\code{string} instead of \code{strop}. \module{string} instead of \module{strop}.
\refbimodindex{strop}

View file

@ -16,14 +16,14 @@ The module defines the following exception and functions:
describing what is wrong. describing what is wrong.
\end{excdesc} \end{excdesc}
\begin{funcdesc}{pack}{fmt\, v1\, v2\, {\rm \ldots}} \begin{funcdesc}{pack}{fmt, v1, v2, {\rm \ldots}}
Return a string containing the values Return a string containing the values
\code{\var{v1}, \var{v2}, {\rm \ldots}} packed according to the given \code{\var{v1}, \var{v2}, {\rm \ldots}} packed according to the given
format. The arguments must match the values required by the format format. The arguments must match the values required by the format
exactly. exactly.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{unpack}{fmt\, string} \begin{funcdesc}{unpack}{fmt, string}
Unpack the string (presumably packed by \code{pack(\var{fmt}, {\rm \ldots})}) Unpack the string (presumably packed by \code{pack(\var{fmt}, {\rm \ldots})})
according to the given format. The result is a tuple even if it according to the given format. The result is a tuple even if it
contains exactly one item. The string must contain exactly the contains exactly one item. The string must contain exactly the

View file

@ -10,7 +10,7 @@ The module defines the following functions:
\setindexsubitem{(in module syslog)} \setindexsubitem{(in module syslog)}
\begin{funcdesc}{syslog}{\optional{priority\,} message} \begin{funcdesc}{syslog}{\optional{priority,} message}
Send the string \var{message} to the system logger. Send the string \var{message} to the system logger.
A trailing newline is added if necessary. A trailing newline is added if necessary.
Each message is tagged with a priority composed of a \var{facility} and Each message is tagged with a priority composed of a \var{facility} and

View file

@ -61,7 +61,7 @@ The \module{spam} module defines the following functions:
% least once in the description; each usage (even inside \code{...}) % least once in the description; each usage (even inside \code{...})
% should be enclosed in \var{...}. % should be enclosed in \var{...}.
\begin{funcdesc}{open}{filename\optional{\, mode\, buffersize}} \begin{funcdesc}{open}{filename\optional{, mode, buffersize}}
Open the file \var{filename} as a can of Spam. The optional Open the file \var{filename} as a can of Spam. The optional
\var{mode} and \var{buffersize} arguments specify the read-write mode \var{mode} and \var{buffersize} arguments specify the read-write mode
(\code{'r'} (default) or \code{'w'}) and the buffer size (default: (\code{'r'} (default) or \code{'w'}) and the buffer size (default:

View file

@ -25,7 +25,7 @@ It defines the following constant and functions:
Raised on thread-specific errors. Raised on thread-specific errors.
\end{excdesc} \end{excdesc}
\begin{funcdesc}{start_new_thread}{func\, arg} \begin{funcdesc}{start_new_thread}{func, arg}
Start a new thread. The thread executes the function \var{func} Start a new thread. The thread executes the function \var{func}
with the argument list \var{arg} (which must be a tuple). When the with the argument list \var{arg} (which must be a tuple). When the
function returns, the thread silently exits. When the function function returns, the thread silently exits. When the function

View file

@ -534,9 +534,9 @@ dictionary entry.
\indexii{dictionary}{type} \indexii{dictionary}{type}
Dictionaries are created by placing a comma-separated list of Dictionaries are created by placing a comma-separated list of
\code{\var{key}:\,\var{value}} pairs within braces, for example: \code{\var{key}: \var{value}} pairs within braces, for example:
\code{\{'jack':\,4098, 'sjoerd':\,4127\}} or \code{\{'jack': 4098, 'sjoerd': 4127\}} or
\code{\{4098:\,'jack', 4127:\,'sjoerd'\}}. \code{\{4098: 'jack', 4127: 'sjoerd'\}}.
The following operations are defined on mappings (where \var{a} is a The following operations are defined on mappings (where \var{a} is a
mapping, \var{k} is a key and \var{x} is an arbitrary object): mapping, \var{k} is a key and \var{x} is an arbitrary object):
@ -767,7 +767,7 @@ descriptors, e.g. module \code{fcntl} or \code{os.read()} and friends.
internal buffer size) are read. internal buffer size) are read.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{seek}{offset\, whence} \begin{funcdesc}{seek}{offset, whence}
Set the file's current position, like \code{stdio}'s \code{fseek()}. Set the file's current position, like \code{stdio}'s \code{fseek()}.
The \var{whence} argument is optional and defaults to \code{0} The \var{whence} argument is optional and defaults to \code{0}
(absolute file positioning); other values are \code{1} (seek (absolute file positioning); other values are \code{1} (seek

View file

@ -55,7 +55,7 @@ Clear the cache that may have been built up by previous calls to
\function{urlretrieve()}. \function{urlretrieve()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{quote}{string\optional{\, addsafe}} \begin{funcdesc}{quote}{string\optional{, addsafe}}
Replace special characters in \var{string} using the \samp{\%xx} escape. Replace special characters in \var{string} using the \samp{\%xx} escape.
Letters, digits, and the characters \character{_,.-} are never quoted. Letters, digits, and the characters \character{_,.-} are never quoted.
The optional \var{addsafe} parameter specifies additional characters The optional \var{addsafe} parameter specifies additional characters
@ -64,7 +64,7 @@ that should not be quoted --- its default value is \code{'/'}.
Example: \code{quote('/\~connolly/')} yields \code{'/\%7econnolly/'}. Example: \code{quote('/\~connolly/')} yields \code{'/\%7econnolly/'}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{quote_plus}{string\optional{\, addsafe}} \begin{funcdesc}{quote_plus}{string\optional{, addsafe}}
Like \function{quote()}, but also replaces spaces by plus signs, as Like \function{quote()}, but also replaces spaces by plus signs, as
required for quoting HTML form values. required for quoting HTML form values.
\end{funcdesc} \end{funcdesc}

View file

@ -61,7 +61,7 @@ URL that was parsed originally had redundant delimiters, e.g. a ? with
an empty query (the draft states that these are equivalent). an empty query (the draft states that these are equivalent).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{urljoin}{base\, url\optional{\, allow_fragments}} \begin{funcdesc}{urljoin}{base, url\optional{, allow_fragments}}
Construct a full (``absolute'') URL by combining a ``base URL'' Construct a full (``absolute'') URL by combining a ``base URL''
(\var{base}) with a ``relative URL'' (\var{url}). Informally, this (\var{base}) with a ``relative URL'' (\var{url}). Informally, this
uses components of the base URL, in particular the addressing scheme, uses components of the base URL, in particular the addressing scheme,

View file

@ -19,7 +19,7 @@ The \module{uu} module defines the following functions:
\setindexsubitem{(in module uu)} \setindexsubitem{(in module uu)}
\begin{funcdesc}{encode}{in_file\, out_file\optional{\, name\, mode}} \begin{funcdesc}{encode}{in_file, out_file\optional{, name, mode}}
Uuencode file \var{in_file} into file \var{out_file}. The uuencoded Uuencode file \var{in_file} into file \var{out_file}. The uuencoded
file will have the header specifying \var{name} and \var{mode} as the file will have the header specifying \var{name} and \var{mode} as the
defaults for the results of decoding the file. The default defaults defaults for the results of decoding the file. The default defaults
@ -27,7 +27,7 @@ are taken from \var{in_file}, or \code{'-'} and \code{0666}
respectively. respectively.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{decode}{in_file\optional{\, out_file\, mode}} \begin{funcdesc}{decode}{in_file\optional{, out_file, mode}}
This call decodes uuencoded file \var{in_file} placing the result on This call decodes uuencoded file \var{in_file} placing the result on
file \var{out_file}. If \var{out_file} is a pathname the \var{mode} is file \var{out_file}. If \var{out_file} is a pathname the \var{mode} is
also set. Defaults for \var{out_file} and \var{mode} are taken from also set. Defaults for \var{out_file} and \var{mode} are taken from

View file

@ -11,7 +11,7 @@ class that is also named \code{whrandom}. Instances of the
Chooses a random element from the non-empty sequence \var{seq} and returns it. Chooses a random element from the non-empty sequence \var{seq} and returns it.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{randint}{a\, b} \begin{funcdesc}{randint}{a, b}
Returns a random integer \var{N} such that \code{\var{a}<=\var{N}<=\var{b}}. Returns a random integer \var{N} such that \code{\var{a}<=\var{N}<=\var{b}}.
\end{funcdesc} \end{funcdesc}
@ -19,7 +19,7 @@ Returns a random integer \var{N} such that \code{\var{a}<=\var{N}<=\var{b}}.
Returns the next random floating point number in the range [0.0 ... 1.0). Returns the next random floating point number in the range [0.0 ... 1.0).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{seed}{x\, y\, z} \begin{funcdesc}{seed}{x, y, z}
Initializes the random number generator from the integers Initializes the random number generator from the integers
\var{x}, \var{x},
\var{y} \var{y}
@ -29,7 +29,7 @@ When the module is first imported, the random number is initialized
using values derived from the current time. using values derived from the current time.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{uniform}{a\, b} \begin{funcdesc}{uniform}{a, b}
Returns a random real number \var{N} such that \code{\var{a}<=\var{N}<\var{b}}. Returns a random real number \var{N} such that \code{\var{a}<=\var{N}<\var{b}}.
\end{funcdesc} \end{funcdesc}

View file

@ -96,7 +96,7 @@ the individual item. At the end of the list, an unsigned integer
\code{0} is packed. \code{0} is packed.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{pack_farray}{n\, array\, pack_item} \begin{funcdesc}{pack_farray}{n, array, pack_item}
Packs a fixed length list (\var{array}) of homogeneous items. \var{n} Packs a fixed length list (\var{array}) of homogeneous items. \var{n}
is the length of the list; it is \emph{not} packed into the buffer, is the length of the list; it is \emph{not} packed into the buffer,
but a \exception{ValueError} exception is raised if but a \exception{ValueError} exception is raised if
@ -104,7 +104,7 @@ but a \exception{ValueError} exception is raised if
\var{pack_item} is the function used to pack each element. \var{pack_item} is the function used to pack each element.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{pack_array}{list\, pack_item} \begin{funcdesc}{pack_array}{list, pack_item}
Packs a variable length \var{list} of homogeneous items. First, the Packs a variable length \var{list} of homogeneous items. First, the
length of the list is packed as an unsigned integer, then each element length of the list is packed as an unsigned integer, then each element
is packed as in \method{pack_farray()} above. is packed as in \method{pack_farray()} above.
@ -192,7 +192,7 @@ then the item is unpacked and appended to the list. A flag of
function that is called to unpack the items. function that is called to unpack the items.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{unpack_farray}{n\, unpack_item} \begin{funcdesc}{unpack_farray}{n, unpack_item}
Unpacks and returns (as a list) a fixed length array of homogeneous Unpacks and returns (as a list) a fixed length array of homogeneous
items. \var{n} is number of list elements to expect in the buffer. items. \var{n} is number of list elements to expect in the buffer.
As above, \var{unpack_item} is the function used to unpack each element. As above, \var{unpack_item} is the function used to unpack each element.

View file

@ -78,7 +78,7 @@ The base implementation simply calls \var{method} with \var{attributes}
as the only argument. as the only argument.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{handle_endtag}{tag\, method} \begin{funcdesc}{handle_endtag}{tag, method}
This method is called to handle endtags for which an This method is called to handle endtags for which an
\code{end_\var{tag}()} method has been defined. The \var{tag} \code{end_\var{tag}()} method has been defined. The \var{tag}
argument is the name of the tag, and the argument is the name of the tag, and the
@ -170,7 +170,7 @@ raise a \exception{RuntimeError} without first calling
\method{syntax_error()}. \method{syntax_error()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{unknown_starttag}{tag\, attributes} \begin{funcdesc}{unknown_starttag}{tag, attributes}
This method is called to process an unknown start tag. It is intended This method is called to process an unknown start tag. It is intended
to be overridden by a derived class; the base class implementation to be overridden by a derived class; the base class implementation
does nothing. does nothing.

View file

@ -14,7 +14,7 @@ later version if one is available.
The available functions in this module are: The available functions in this module are:
\setindexsubitem{(in module zlib)} \setindexsubitem{(in module zlib)}
\begin{funcdesc}{adler32}{string\optional{\, value}} \begin{funcdesc}{adler32}{string\optional{, value}}
Computes a Adler-32 checksum of \var{string}. (An Adler-32 Computes a Adler-32 checksum of \var{string}. (An Adler-32
checksum is almost as reliable as a CRC32 but can be computed much checksum is almost as reliable as a CRC32 but can be computed much
more quickly.) If \var{value} is present, it is used as the more quickly.) If \var{value} is present, it is used as the
@ -25,7 +25,7 @@ The available functions in this module are:
authentication or digital signatures. authentication or digital signatures.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{compress}{string\optional{\, level}} \begin{funcdesc}{compress}{string\optional{, level}}
Compresses the data in \var{string}, returning a string contained Compresses the data in \var{string}, returning a string contained
compressed data. \var{level} is an integer from \code{1} to \code{9} compressed data. \var{level} is an integer from \code{1} to \code{9}
controlling the level of compression; \code{1} is fastest and produces controlling the level of compression; \code{1} is fastest and produces
@ -42,7 +42,7 @@ exception if any error occurs.
produces the most. The default value is \code{6}. produces the most. The default value is \code{6}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{crc32}{string\optional{\, value}} \begin{funcdesc}{crc32}{string\optional{, value}}
Computes a CRC (Cyclic Redundancy Check) sum of \var{string}. If Computes a CRC (Cyclic Redundancy Check) sum of \var{string}. If
\var{value} is present, it is used as the starting value of the \var{value} is present, it is used as the starting value of the
checksum; otherwise, a fixed default value is used. This allows checksum; otherwise, a fixed default value is used. This allows

View file

@ -24,7 +24,7 @@ second's worth occupies 2*2*44100 bytes, i.e.\ 176,400 bytes.
Module \code{aifc} defines the following function: Module \code{aifc} defines the following function:
\setindexsubitem{(in module aifc)} \setindexsubitem{(in module aifc)}
\begin{funcdesc}{open}{file\, mode} \begin{funcdesc}{open}{file, mode}
Open an AIFF or AIFF-C file and return an object instance with Open an AIFF or AIFF-C file and return an object instance with
methods that are described below. The argument file is either a methods that are described below. The argument file is either a
string naming a file or a file object. The mode is either the string string naming a file or a file object. The mode is either the string
@ -146,7 +146,7 @@ If this parameter is not set, or not set correctly, the file needs to
support seeking. support seeking.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setcomptype}{type\, name} \begin{funcdesc}{setcomptype}{type, name}
Specify the compression type. If not specified, the audio data will Specify the compression type. If not specified, the audio data will
not be compressed. In AIFF files, compression is not possible. The not be compressed. In AIFF files, compression is not possible. The
name parameter should be a human-readable description of the name parameter should be a human-readable description of the
@ -155,14 +155,14 @@ string. Currently the following compression types are supported:
NONE, ULAW, ALAW, G722. NONE, ULAW, ALAW, G722.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setparams}{nchannels\, sampwidth\, framerate\, comptype\, compname} \begin{funcdesc}{setparams}{nchannels, sampwidth, framerate, comptype, compname}
Set all the above parameters at once. The argument is a tuple Set all the above parameters at once. The argument is a tuple
consisting of the various parameters. This means that it is possible consisting of the various parameters. This means that it is possible
to use the result of a \code{getparams()} call as argument to to use the result of a \code{getparams()} call as argument to
\code{setparams()}. \code{setparams()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setmark}{id\, pos\, name} \begin{funcdesc}{setmark}{id, pos, name}
Add a mark with the given id (larger than 0), and the given name at Add a mark with the given id (larger than 0), and the given name at
the given position. This method can be called at any time before the given position. This method can be called at any time before
\code{close()}. \code{close()}.

View file

@ -27,7 +27,7 @@ The module defines the following functions:
\setindexsubitem{(in module al)} \setindexsubitem{(in module al)}
\begin{funcdesc}{openport}{name\, direction\optional{\, config}} \begin{funcdesc}{openport}{name, direction\optional{, config}}
The name and direction arguments are strings. The optional config The name and direction arguments are strings. The optional config
argument is a configuration object as returned by argument is a configuration object as returned by
\code{al.newconfig()}. The return value is an \dfn{port object}; \code{al.newconfig()}. The return value is an \dfn{port object};
@ -44,12 +44,12 @@ The device argument is an integer. The return value is a list of
integers containing the data returned by ALqueryparams(). integers containing the data returned by ALqueryparams().
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{getparams}{device\, list} \begin{funcdesc}{getparams}{device, list}
The device argument is an integer. The list argument is a list such The device argument is an integer. The list argument is a list such
as returned by \code{queryparams}; it is modified in place (!). as returned by \code{queryparams}; it is modified in place (!).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setparams}{device\, list} \begin{funcdesc}{setparams}{device, list}
The device argument is an integer. The list argument is a list such The device argument is an integer. The list argument is a list such
as returned by \code{al.queryparams}. as returned by \code{al.queryparams}.
\end{funcdesc} \end{funcdesc}

View file

@ -12,7 +12,7 @@ the exception \code{amoeba.error = 'amoeba.error'}.
The module \code{amoeba} defines the following items: The module \code{amoeba} defines the following items:
\setindexsubitem{(in module amoeba)} \setindexsubitem{(in module amoeba)}
\begin{funcdesc}{name_append}{path\, cap} \begin{funcdesc}{name_append}{path, cap}
Stores a capability in the Amoeba directory tree. Stores a capability in the Amoeba directory tree.
Arguments are the pathname (a string) and the capability (a capability Arguments are the pathname (a string) and the capability (a capability
object as returned by object as returned by
@ -32,7 +32,7 @@ Returns a
object, to which various interesting operations apply, described below. object, to which various interesting operations apply, described below.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{name_replace}{path\, cap} \begin{funcdesc}{name_replace}{path, cap}
Replaces a capability in the Amoeba directory tree. Replaces a capability in the Amoeba directory tree.
Arguments are the pathname and the new capability. Arguments are the pathname and the new capability.
(This differs from (This differs from
@ -91,7 +91,7 @@ The following methods are defined for capability objects.
Returns a list of the names of the entries in an Amoeba directory. Returns a list of the names of the entries in an Amoeba directory.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{b_read}{offset\, maxsize} \begin{funcdesc}{b_read}{offset, maxsize}
Reads (at most) Reads (at most)
\var{maxsize} \var{maxsize}
bytes from a bullet file at offset bytes from a bullet file at offset

View file

@ -13,7 +13,7 @@ will be used. Both modules provide the same interface:
% at the same time. % at the same time.
\setindexsubitem{(in modules anydbm, dumbdbm)} \setindexsubitem{(in modules anydbm, dumbdbm)}
\begin{funcdesc}{open}{filename\optional{\, flag\, mode}} \begin{funcdesc}{open}{filename\optional{, flag, mode}}
Open the database file \var{filename} and return a corresponding object. Open the database file \var{filename} and return a corresponding object.
The optional \var{flag} argument can be The optional \var{flag} argument can be
\code{'r'} to open an existing database for reading only, \code{'r'} to open an existing database for reading only,

View file

@ -35,7 +35,7 @@ See also built-in module \module{struct}\refbimodindex{struct}.
The module defines the following function: The module defines the following function:
\begin{funcdesc}{array}{typecode\optional{\, initializer}} \begin{funcdesc}{array}{typecode\optional{, initializer}}
Return a new array whose items are restricted by \var{typecode}, and Return a new array whose items are restricted by \var{typecode}, and
initialized from the optional \var{initializer} value, which must be a initialized from the optional \var{initializer} value, which must be a
list or a string. The list or string is passed to the new array's list or a string. The list or string is passed to the new array's
@ -77,7 +77,7 @@ integer values. It is useful when reading data from a file written
on a machine with a different byte order. on a machine with a different byte order.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{fromfile}{f\, n} \begin{funcdesc}{fromfile}{f, n}
Read \var{n} items (as machine values) from the file object \var{f} Read \var{n} items (as machine values) from the file object \var{f}
and append them to the end of the array. If less than \var{n} items and append them to the end of the array. If less than \var{n} items
are available, \exception{EOFError} is raised, but the items that were are available, \exception{EOFError} is raised, but the items that were
@ -98,12 +98,12 @@ array of machine values (i.e. as if it had been read from a
file using the \method{fromfile()} method). file using the \method{fromfile()} method).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{insert}{i\, x} \begin{funcdesc}{insert}{i, x}
Insert a new item with value \var{x} in the array before position Insert a new item with value \var{x} in the array before position
\var{i}. \var{i}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{read}{f\, n} \begin{funcdesc}{read}{f, n}
\deprecated {1.5.1} \deprecated {1.5.1}
{Use the \method{fromfile()} method.} {Use the \method{fromfile()} method.}
Read \var{n} items (as machine values) from the file object \var{f} Read \var{n} items (as machine values) from the file object \var{f}

View file

@ -19,46 +19,46 @@ This exception is raised on all errors, such as unknown number of bytes
per sample, etc. per sample, etc.
\end{excdesc} \end{excdesc}
\begin{funcdesc}{add}{fragment1\, fragment2\, width} \begin{funcdesc}{add}{fragment1, fragment2, width}
Return a fragment which is the addition of the two samples passed as Return a fragment which is the addition of the two samples passed as
parameters. \var{width} is the sample width in bytes, either parameters. \var{width} is the sample width in bytes, either
\code{1}, \code{2} or \code{4}. Both fragments should have the same \code{1}, \code{2} or \code{4}. Both fragments should have the same
length. length.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{adpcm2lin}{adpcmfragment\, width\, state} \begin{funcdesc}{adpcm2lin}{adpcmfragment, width, state}
Decode an Intel/DVI ADPCM coded fragment to a linear fragment. See Decode an Intel/DVI ADPCM coded fragment to a linear fragment. See
the description of \code{lin2adpcm} for details on ADPCM coding. the description of \code{lin2adpcm} for details on ADPCM coding.
Return a tuple \code{(\var{sample}, \var{newstate})} where the sample Return a tuple \code{(\var{sample}, \var{newstate})} where the sample
has the width specified in \var{width}. has the width specified in \var{width}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{adpcm32lin}{adpcmfragment\, width\, state} \begin{funcdesc}{adpcm32lin}{adpcmfragment, width, state}
Decode an alternative 3-bit ADPCM code. See \code{lin2adpcm3} for Decode an alternative 3-bit ADPCM code. See \code{lin2adpcm3} for
details. details.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{avg}{fragment\, width} \begin{funcdesc}{avg}{fragment, width}
Return the average over all samples in the fragment. Return the average over all samples in the fragment.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{avgpp}{fragment\, width} \begin{funcdesc}{avgpp}{fragment, width}
Return the average peak-peak value over all samples in the fragment. Return the average peak-peak value over all samples in the fragment.
No filtering is done, so the usefulness of this routine is No filtering is done, so the usefulness of this routine is
questionable. questionable.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{bias}{fragment\, width\, bias} \begin{funcdesc}{bias}{fragment, width, bias}
Return a fragment that is the original fragment with a bias added to Return a fragment that is the original fragment with a bias added to
each sample. each sample.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{cross}{fragment\, width} \begin{funcdesc}{cross}{fragment, width}
Return the number of zero crossings in the fragment passed as an Return the number of zero crossings in the fragment passed as an
argument. argument.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{findfactor}{fragment\, reference} \begin{funcdesc}{findfactor}{fragment, reference}
Return a factor \var{F} such that Return a factor \var{F} such that
\code{rms(add(fragment, mul(reference, -F)))} is minimal, i.e., \code{rms(add(fragment, mul(reference, -F)))} is minimal, i.e.,
return the factor with which you should multiply \var{reference} to return the factor with which you should multiply \var{reference} to
@ -68,7 +68,7 @@ should both contain 2-byte samples.
The time taken by this routine is proportional to \code{len(fragment)}. The time taken by this routine is proportional to \code{len(fragment)}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{findfit}{fragment\, reference} \begin{funcdesc}{findfit}{fragment, reference}
This routine (which only accepts 2-byte sample fragments) This routine (which only accepts 2-byte sample fragments)
Try to match \var{reference} as well as possible to a portion of Try to match \var{reference} as well as possible to a portion of
@ -82,7 +82,7 @@ and \var{factor} is the (floating-point) factor as per
\code{findfactor}. \code{findfactor}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{findmax}{fragment\, length} \begin{funcdesc}{findmax}{fragment, length}
Search \var{fragment} for a slice of length \var{length} samples (not Search \var{fragment} for a slice of length \var{length} samples (not
bytes!)\ with maximum energy, i.e., return \var{i} for which bytes!)\ with maximum energy, i.e., return \var{i} for which
\code{rms(fragment[i*2:(i+length)*2])} is maximal. The fragments \code{rms(fragment[i*2:(i+length)*2])} is maximal. The fragments
@ -91,15 +91,15 @@ should both contain 2-byte samples.
The routine takes time proportional to \code{len(fragment)}. The routine takes time proportional to \code{len(fragment)}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{getsample}{fragment\, width\, index} \begin{funcdesc}{getsample}{fragment, width, index}
Return the value of sample \var{index} from the fragment. Return the value of sample \var{index} from the fragment.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{lin2lin}{fragment\, width\, newwidth} \begin{funcdesc}{lin2lin}{fragment, width, newwidth}
Convert samples between 1-, 2- and 4-byte formats. Convert samples between 1-, 2- and 4-byte formats.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{lin2adpcm}{fragment\, width\, state} \begin{funcdesc}{lin2adpcm}{fragment, width, state}
Convert samples to 4 bit Intel/DVI ADPCM encoding. ADPCM coding is an Convert samples to 4 bit Intel/DVI ADPCM encoding. ADPCM coding is an
adaptive coding scheme, whereby each 4 bit number is the difference adaptive coding scheme, whereby each 4 bit number is the difference
between one sample and the next, divided by a (varying) step. The between one sample and the next, divided by a (varying) step. The
@ -113,41 +113,41 @@ initial call \code{None} can be passed as the state. \var{adpcmfrag}
is the ADPCM coded fragment packed 2 4-bit values per byte. is the ADPCM coded fragment packed 2 4-bit values per byte.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{lin2adpcm3}{fragment\, width\, state} \begin{funcdesc}{lin2adpcm3}{fragment, width, state}
This is an alternative ADPCM coder that uses only 3 bits per sample. This is an alternative ADPCM coder that uses only 3 bits per sample.
It is not compatible with the Intel/DVI ADPCM coder and its output is It is not compatible with the Intel/DVI ADPCM coder and its output is
not packed (due to laziness on the side of the author). Its use is not packed (due to laziness on the side of the author). Its use is
discouraged. discouraged.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{lin2ulaw}{fragment\, width} \begin{funcdesc}{lin2ulaw}{fragment, width}
Convert samples in the audio fragment to U-LAW encoding and return Convert samples in the audio fragment to U-LAW encoding and return
this as a Python string. U-LAW is an audio encoding format whereby this as a Python string. U-LAW is an audio encoding format whereby
you get a dynamic range of about 14 bits using only 8 bit samples. It you get a dynamic range of about 14 bits using only 8 bit samples. It
is used by the Sun audio hardware, among others. is used by the Sun audio hardware, among others.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{minmax}{fragment\, width} \begin{funcdesc}{minmax}{fragment, width}
Return a tuple consisting of the minimum and maximum values of all Return a tuple consisting of the minimum and maximum values of all
samples in the sound fragment. samples in the sound fragment.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{max}{fragment\, width} \begin{funcdesc}{max}{fragment, width}
Return the maximum of the \emph{absolute value} of all samples in a Return the maximum of the \emph{absolute value} of all samples in a
fragment. fragment.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{maxpp}{fragment\, width} \begin{funcdesc}{maxpp}{fragment, width}
Return the maximum peak-peak value in the sound fragment. Return the maximum peak-peak value in the sound fragment.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{mul}{fragment\, width\, factor} \begin{funcdesc}{mul}{fragment, width, factor}
Return a fragment that has all samples in the original framgent Return a fragment that has all samples in the original framgent
multiplied by the floating-point value \var{factor}. Overflow is multiplied by the floating-point value \var{factor}. Overflow is
silently ignored. silently ignored.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{ratecv}{fragment\, width\, nchannels\, inrate\, outrate\, state\optional{\, weightA\, weightB}} \begin{funcdesc}{ratecv}{fragment, width, nchannels, inrate, outrate, state\optional{, weightA, weightB}}
Convert the frame rate of the input fragment. Convert the frame rate of the input fragment.
\code{State} is a tuple containing the state of the converter. The \code{State} is a tuple containing the state of the converter. The
@ -158,11 +158,11 @@ The \code{weightA} and \code{weightB} arguments are parameters for a
simple digital filter and default to 1 and 0 respectively. simple digital filter and default to 1 and 0 respectively.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{reverse}{fragment\, width} \begin{funcdesc}{reverse}{fragment, width}
Reverse the samples in a fragment and returns the modified fragment. Reverse the samples in a fragment and returns the modified fragment.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{rms}{fragment\, width} \begin{funcdesc}{rms}{fragment, width}
Return the root-mean-square of the fragment, i.e. Return the root-mean-square of the fragment, i.e.
\iftexi \iftexi
the square root of the quotient of the sum of all squared sample value, the square root of the quotient of the sum of all squared sample value,
@ -177,20 +177,20 @@ divided by the sumber of samples.
This is a measure of the power in an audio signal. This is a measure of the power in an audio signal.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{tomono}{fragment\, width\, lfactor\, rfactor} \begin{funcdesc}{tomono}{fragment, width, lfactor, rfactor}
Convert a stereo fragment to a mono fragment. The left channel is Convert a stereo fragment to a mono fragment. The left channel is
multiplied by \var{lfactor} and the right channel by \var{rfactor} multiplied by \var{lfactor} and the right channel by \var{rfactor}
before adding the two channels to give a mono signal. before adding the two channels to give a mono signal.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{tostereo}{fragment\, width\, lfactor\, rfactor} \begin{funcdesc}{tostereo}{fragment, width, lfactor, rfactor}
Generate a stereo fragment from a mono fragment. Each pair of samples Generate a stereo fragment from a mono fragment. Each pair of samples
in the stereo fragment are computed from the mono sample, whereby left in the stereo fragment are computed from the mono sample, whereby left
channel samples are multiplied by \var{lfactor} and right channel channel samples are multiplied by \var{lfactor} and right channel
samples by \var{rfactor}. samples by \var{rfactor}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{ulaw2lin}{fragment\, width} \begin{funcdesc}{ulaw2lin}{fragment, width}
Convert sound fragments in ULAW encoding to linearly encoded sound Convert sound fragments in ULAW encoding to linearly encoded sound
fragments. ULAW encoding always uses 8 bits samples, so \var{width} fragments. ULAW encoding always uses 8 bits samples, so \var{width}
refers only to the sample width of the output fragment here. refers only to the sample width of the output fragment here.

View file

@ -157,7 +157,7 @@ followed by text composed using the \member{error_message_format}
class variable. class variable.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{send_response}{code\optional{\, message}} \begin{funcdesc}{send_response}{code\optional{, message}}
Sends a response header and logs the accepted request. The HTTP Sends a response header and logs the accepted request. The HTTP
response line is sent, followed by \emph{Server} and \emph{Date} response line is sent, followed by \emph{Server} and \emph{Date}
headers. The values for these two headers are picked up from the headers. The values for these two headers are picked up from the
@ -165,7 +165,7 @@ headers. The values for these two headers are picked up from the
respectively. respectively.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{send_header}{keyword\, value} \begin{funcdesc}{send_header}{keyword, value}
Writes a specific MIME header to the output stream. \var{keyword} Writes a specific MIME header to the output stream. \var{keyword}
should specify the header keyword, with \var{value} specifying should specify the header keyword, with \var{value} specifying
its value. its value.
@ -176,7 +176,7 @@ Sends a blank line, indicating the end of the MIME headers in
the response. the response.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{log_request}{\optional{code\optional{\, size}}} \begin{funcdesc}{log_request}{\optional{code\optional{, size}}}
Logs an accepted (successful) request. \var{code} should specify Logs an accepted (successful) request. \var{code} should specify
the numeric HTTP code associated with the response. If a size of the numeric HTTP code associated with the response. If a size of
the response is available, then it should be passed as the the response is available, then it should be passed as the

View file

@ -17,7 +17,7 @@ other, unsafe attributes.
% I've punted on the issue of documenting keyword arguments for now. % I've punted on the issue of documenting keyword arguments for now.
\begin{funcdesc}{Bastion}{object\optional{\, filter\, name\, class}} \begin{funcdesc}{Bastion}{object\optional{, filter, name, class}}
Protect the object \var{object}, returning a bastion for the Protect the object \var{object}, returning a bastion for the
object. Any attempt to access one of the object's attributes will object. Any attempt to access one of the object's attributes will
have to be approved by the \var{filter} function; if the access is have to be approved by the \var{filter} function; if the access is

View file

@ -11,14 +11,14 @@ The \code{binhex} module defines the following functions:
\setindexsubitem{(in module binhex)} \setindexsubitem{(in module binhex)}
\begin{funcdesc}{binhex}{input\, output} \begin{funcdesc}{binhex}{input, output}
Convert a binary file with filename \var{input} to binhex file Convert a binary file with filename \var{input} to binhex file
\var{output}. The \var{output} parameter can either be a filename or a \var{output}. The \var{output} parameter can either be a filename or a
file-like object (any object supporting a \var{write} and \var{close} file-like object (any object supporting a \var{write} and \var{close}
method). method).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{hexbin}{input\optional{\, output}} \begin{funcdesc}{hexbin}{input\optional{, output}}
Decode a binhex file \var{input}. \var{input} may be a filename or a Decode a binhex file \var{input}. \var{input} may be a filename or a
file-like object supporting \var{read} and \var{close} methods. file-like object supporting \var{read} and \var{close} methods.
The resulting file is written to a file named \var{output}, unless the The resulting file is written to a file named \var{output}, unless the

View file

@ -191,7 +191,7 @@ Parse a query string given as a string argument (data of type
\mimetype{application/x-www-form-urlencoded}). \mimetype{application/x-www-form-urlencoded}).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{parse_multipart}{fp\, pdict} \begin{funcdesc}{parse_multipart}{fp, pdict}
Parse input of type \mimetype{multipart/form-data} (for Parse input of type \mimetype{multipart/form-data} (for
file uploads). Arguments are \var{fp} for the input file and file uploads). Arguments are \var{fp} for the input file and
\var{pdict} for the dictionary containing other parameters of \var{pdict} for the dictionary containing other parameters of
@ -236,7 +236,7 @@ Print a list of useful (used by CGI) environment variables in
HTML. HTML.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{escape}{s\optional{\, quote}} \begin{funcdesc}{escape}{s\optional{, quote}}
Convert the characters Convert the characters
\character{\&}, \character{<} and \character{>} in string \var{s} to \character{\&}, \character{<} and \character{>} in string \var{s} to
HTML-safe sequences. Use this if you need to display text that might HTML-safe sequences. Use this if you need to display text that might

View file

@ -10,7 +10,7 @@ attempting to crack \UNIX{} passwords with a dictionary.
\index{crypt(3)} \index{crypt(3)}
\setindexsubitem{(in module crypt)} \setindexsubitem{(in module crypt)}
\begin{funcdesc}{crypt}{word\, salt} \begin{funcdesc}{crypt}{word, salt}
\var{word} will usually be a user's password. \var{salt} is a \var{word} will usually be a user's password. \var{salt} is a
2-character string which will be used to select one of 4096 variations 2-character string which will be used to select one of 4096 variations
of DES\indexii{cipher}{DES}. The characters in \var{salt} must be of DES\indexii{cipher}{DES}. The characters in \var{salt} must be

View file

@ -34,7 +34,7 @@ Bits in the status as returned by \var{Status}.
Return 1 if the communication toolbox is available, zero otherwise. Return 1 if the communication toolbox is available, zero otherwise.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{CMNew}{name\, sizes} \begin{funcdesc}{CMNew}{name, sizes}
Create a connection object using the connection tool named Create a connection object using the connection tool named
\var{name}. \var{sizes} is a 6-tuple given buffer sizes for data in, \var{name}. \var{sizes} is a 6-tuple given buffer sizes for data in,
data out, control in, control out, attention in and attention out. data out, control in, control out, attention in and attention out.
@ -77,21 +77,21 @@ Accept (when \var{yesno} is non-zero) or reject an incoming call after
\var{Listen} returned. \var{Listen} returned.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{Close}{timeout\, now} \begin{funcdesc}{Close}{timeout, now}
Close a connection. When \var{now} is zero, the close is orderly Close a connection. When \var{now} is zero, the close is orderly
(i.e.\ outstanding output is flushed, etc.)\ with a timeout of (i.e.\ outstanding output is flushed, etc.)\ with a timeout of
\var{timeout} seconds. When \var{now} is non-zero the close is \var{timeout} seconds. When \var{now} is non-zero the close is
immediate, discarding output. immediate, discarding output.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{Read}{len\, chan\, timeout} \begin{funcdesc}{Read}{len, chan, timeout}
Read \var{len} bytes, or until \var{timeout} seconds have passed, from Read \var{len} bytes, or until \var{timeout} seconds have passed, from
the channel \var{chan} (which is one of \var{cmData}, \var{cmCntl} or the channel \var{chan} (which is one of \var{cmData}, \var{cmCntl} or
\var{cmAttn}). Return a 2-tuple:\ the data read and the end-of-message \var{cmAttn}). Return a 2-tuple:\ the data read and the end-of-message
flag. flag.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{Write}{buf\, chan\, timeout\, eom} \begin{funcdesc}{Write}{buf, chan, timeout, eom}
Write \var{buf} to channel \var{chan}, aborting after \var{timeout} Write \var{buf} to channel \var{chan}, aborting after \var{timeout}
seconds. When \var{eom} has the value \var{cmFlagsEOM} an seconds. When \var{eom} has the value \var{cmFlagsEOM} an
end-of-message indicator will be written after the data (if this end-of-message indicator will be written after the data (if this

View file

@ -20,7 +20,7 @@ Raised on dbm-specific errors, such as I/O errors. \code{KeyError} is
raised for general mapping errors like specifying an incorrect key. raised for general mapping errors like specifying an incorrect key.
\end{excdesc} \end{excdesc}
\begin{funcdesc}{open}{filename\, \optional{flag\, \optional{mode}}} \begin{funcdesc}{open}{filename, \optional{flag, \optional{mode}}}
Open a dbm database and return a dbm object. The \var{filename} Open a dbm database and return a dbm object. The \var{filename}
argument is the name of the database file (without the \file{.dir} or argument is the name of the database file (without the \file{.dir} or
\file{.pag} extensions). \file{.pag} extensions).

View file

@ -49,7 +49,7 @@ traceback if none was passed. The instruction causing the exception
is indicated. is indicated.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{disassemble}{code\optional{\, lasti}} \begin{funcdesc}{disassemble}{code\optional{, lasti}}
Disassembles a code object, indicating the last instruction if \var{lasti} Disassembles a code object, indicating the last instruction if \var{lasti}
was provided. The output is divided in the following columns: was provided. The output is divided in the following columns:
\begin{itemize} \begin{itemize}
@ -65,7 +65,7 @@ variable names, constant values, branch targets, and compare
operators. operators.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{disco}{code\optional{\, lasti}} \begin{funcdesc}{disco}{code\optional{, lasti}}
A synonym for disassemble. It is more convenient to type, and kept A synonym for disassemble. It is more convenient to type, and kept
for compatibility with earlier Python releases. for compatibility with earlier Python releases.
\end{funcdesc} \end{funcdesc}

View file

@ -66,7 +66,7 @@ Add a hard line break if one does not already exist. This does not
break the logical paragraph. break the logical paragraph.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{add_hor_rule}{*args\, **kw} \begin{funcdesc}{add_hor_rule}{*args, **kw}
Insert a horizontal rule in the output. A hard break is inserted if Insert a horizontal rule in the output. A hard break is inserted if
there is data in the current paragraph, but the logical paragraph is there is data in the current paragraph, but the logical paragraph is
not broken. The arguments and keywords are passed on to the writer's not broken. The arguments and keywords are passed on to the writer's
@ -268,7 +268,7 @@ lines, or the equivelent. The \var{blankline} value will be an
integer. integer.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{send_hor_rule}{*args\, **kw} \begin{funcdesc}{send_hor_rule}{*args, **kw}
Display a horizontal rule on the output device. The arguments to this Display a horizontal rule on the output device. The arguments to this
method are entirely application- and writer-specific, and should be method are entirely application- and writer-specific, and should be
interpreted with care. The method implementation may assume that a interpreted with care. The method implementation may assume that a
@ -317,7 +317,7 @@ else. Each method simply announces itself by printing its name and
arguments on standard output. arguments on standard output.
\end{classdesc} \end{classdesc}
\begin{classdesc}{DumbWriter}{\optional{file\optional{\, maxcol\code{ = 72}}}} \begin{classdesc}{DumbWriter}{\optional{file\optional{, maxcol\code{ = 72}}}}
Simple writer class which writes output on the file object passed in Simple writer class which writes output on the file object passed in
as \var{file} or, if \var{file} is omitted, on standard output. The as \var{file} or, if \var{file} is omitted, on standard output. The
output is simply word-wrapped to the number of columns specified by output is simply word-wrapped to the number of columns specified by

View file

@ -31,14 +31,14 @@ An object representing the menubar. This object is usually not created
by the user. by the user.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{Menu}{bar\, title\optional{\, after}} \begin{funcdesc}{Menu}{bar, title\optional{, after}}
An object representing a menu. Upon creation you pass the An object representing a menu. Upon creation you pass the
\code{MenuBar} the menu appears in, the \var{title} string and a \code{MenuBar} the menu appears in, the \var{title} string and a
position (1-based) \var{after} where the menu should appear (default: position (1-based) \var{after} where the menu should appear (default:
at the end). at the end).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{MenuItem}{menu\, title\optional{\, shortcut\, callback}} \begin{funcdesc}{MenuItem}{menu, title\optional{, shortcut, callback}}
Create a menu item object. The arguments are the menu to crate the Create a menu item object. The arguments are the menu to crate the
item it, the item title string and optionally the keyboard shortcut item it, the item title string and optionally the keyboard shortcut
and a callback routine. The callback is called with the arguments and a callback routine. The callback is called with the arguments
@ -58,7 +58,7 @@ correct dimming for all menu items based on the current front window.
Add a separator to the end of a menu. Add a separator to the end of a menu.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{SubMenu}{menu\, label} \begin{funcdesc}{SubMenu}{menu, label}
Create a submenu named \var{label} under menu \var{menu}. The menu Create a submenu named \var{label} under menu \var{menu}. The menu
object is returned. object is returned.
\end{funcdesc} \end{funcdesc}
@ -72,7 +72,7 @@ which the window belongs. The window is not displayed until later.
Creates a modeless dialog window. Creates a modeless dialog window.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{windowbounds}{width\, height} \begin{funcdesc}{windowbounds}{width, height}
Return a \code{(left, top, right, bottom)} tuple suitable for creation Return a \code{(left, top, right, bottom)} tuple suitable for creation
of a window of given width and height. The window will be staggered of a window of given width and height. The window will be staggered
with respect to previous windows, and an attempt is made to keep the with respect to previous windows, and an attempt is made to keep the
@ -104,7 +104,7 @@ application. Alternatively, override the \code{do_about} method for
more elaborate about messages. more elaborate about messages.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{mainloop}{\optional{mask\, wait}} \begin{funcdesc}{mainloop}{\optional{mask, wait}}
This routine is the main event loop, call it to set your application This routine is the main event loop, call it to set your application
rolling. \var{Mask} is the mask of events you want to handle, rolling. \var{Mask} is the mask of events you want to handle,
\var{wait} is the number of ticks you want to leave to other \var{wait} is the number of ticks you want to leave to other
@ -145,7 +145,7 @@ The old on/off value is returned.
Terminate the event \code{mainloop} at the next convenient moment. Terminate the event \code{mainloop} at the next convenient moment.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_char}{c\, event} \begin{funcdesc}{do_char}{c, event}
The user typed character \var{c}. The complete details of the event The user typed character \var{c}. The complete details of the event
can be found in the \var{event} structure. This method can also be can be found in the \var{event} structure. This method can also be
provided in a \code{Window} object, which overrides the provided in a \code{Window} object, which overrides the
@ -181,22 +181,22 @@ Override this method to do any special processing on window
close. Call \code{self.do_postclose} to cleanup the parent state. close. Call \code{self.do_postclose} to cleanup the parent state.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_postresize}{width\, height\, macoswindowid} \begin{funcdesc}{do_postresize}{width, height, macoswindowid}
Called after the window is resized. Override if more needs to be done Called after the window is resized. Override if more needs to be done
than calling \code{InvalRect}. than calling \code{InvalRect}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_contentclick}{local\, modifiers\, event} \begin{funcdesc}{do_contentclick}{local, modifiers, event}
The user clicked in the content part of a window. The arguments are The user clicked in the content part of a window. The arguments are
the coordinates (window-relative), the key modifiers and the raw the coordinates (window-relative), the key modifiers and the raw
event. event.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_update}{macoswindowid\, event} \begin{funcdesc}{do_update}{macoswindowid, event}
An update event for the window was received. Redraw the window. An update event for the window was received. Redraw the window.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_activate}{activate\, event} \begin{funcdesc}{do_activate}{activate, event}
The window was activated (\code{activate==1}) or deactivated The window was activated (\code{activate==1}) or deactivated
(\code{activate==0}). Handle things like focus highlighting, etc. (\code{activate==0}). Handle things like focus highlighting, etc.
\end{funcdesc} \end{funcdesc}
@ -208,7 +208,7 @@ ControlsWindow objects have the following methods besides those of
\setindexsubitem{(ControlsWindow method)} \setindexsubitem{(ControlsWindow method)}
\begin{funcdesc}{do_controlhit}{window\, control\, pcode\, event} \begin{funcdesc}{do_controlhit}{window, control, pcode, event}
Part \code{pcode} of control \code{control} was hit by the Part \code{pcode} of control \code{control} was hit by the
user. Tracking and such has already been taken care of. user. Tracking and such has already been taken care of.
\end{funcdesc} \end{funcdesc}
@ -220,7 +220,7 @@ extra methods:
\setindexsubitem{(ScrolledWindow method)} \setindexsubitem{(ScrolledWindow method)}
\begin{funcdesc}{scrollbars}{\optional{wantx\, wanty}} \begin{funcdesc}{scrollbars}{\optional{wantx, wanty}}
Create (or destroy) horizontal and vertical scrollbars. The arguments Create (or destroy) horizontal and vertical scrollbars. The arguments
specify which you want (default: both). The scrollbars always have specify which you want (default: both). The scrollbars always have
minimum \code{0} and maximum \code{32767}. minimum \code{0} and maximum \code{32767}.
@ -238,32 +238,32 @@ Call this method when the document has changed. It will call
\code{getscrollbarvalues} and update the scrollbars. \code{getscrollbarvalues} and update the scrollbars.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{scrollbar_callback}{which\, what\, value} \begin{funcdesc}{scrollbar_callback}{which, what, value}
Supplied by you and called after user interaction. \code{Which} will Supplied by you and called after user interaction. \code{Which} will
be \code{'x'} or \code{'y'}, \code{what} will be \code{'-'}, be \code{'x'} or \code{'y'}, \code{what} will be \code{'-'},
\code{'--'}, \code{'set'}, \code{'++'} or \code{'+'}. For \code{'--'}, \code{'set'}, \code{'++'} or \code{'+'}. For
\code{'set'}, \code{value} will contain the new scrollbar position. \code{'set'}, \code{value} will contain the new scrollbar position.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{scalebarvalues}{absmin\, absmax\, curmin\, curmax} \begin{funcdesc}{scalebarvalues}{absmin, absmax, curmin, curmax}
Auxiliary method to help you calculate values to return from Auxiliary method to help you calculate values to return from
\code{getscrollbarvalues}. You pass document minimum and maximum value \code{getscrollbarvalues}. You pass document minimum and maximum value
and topmost (leftmost) and bottommost (rightmost) visible values and and topmost (leftmost) and bottommost (rightmost) visible values and
it returns the correct number or \code{None}. it returns the correct number or \code{None}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_activate}{onoff\, event} \begin{funcdesc}{do_activate}{onoff, event}
Takes care of dimming/highlighting scrollbars when a window becomes Takes care of dimming/highlighting scrollbars when a window becomes
frontmost vv. If you override this method call this one at the end of frontmost vv. If you override this method call this one at the end of
your method. your method.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_postresize}{width\, height\, window} \begin{funcdesc}{do_postresize}{width, height, window}
Moves scrollbars to the correct position. Call this method initially Moves scrollbars to the correct position. Call this method initially
if you override it. if you override it.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_controlhit}{window\, control\, pcode\, event} \begin{funcdesc}{do_controlhit}{window, control, pcode, event}
Handles scrollbar interaction. If you override it call this method Handles scrollbar interaction. If you override it call this method
first, a nonzero return value indicates the hit was in the scrollbars first, a nonzero return value indicates the hit was in the scrollbars
and has been handled. and has been handled.
@ -281,7 +281,7 @@ Create the dialog window, from the DLOG resource with id
\var{resid}. The dialog object is stored in \code{self.wid}. \var{resid}. The dialog object is stored in \code{self.wid}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{do_itemhit}{item\, event} \begin{funcdesc}{do_itemhit}{item, event}
Item number \var{item} was hit. You are responsible for redrawing Item number \var{item} was hit. You are responsible for redrawing
toggle buttons, etc. toggle buttons, etc.
\end{funcdesc} \end{funcdesc}

View file

@ -54,7 +54,7 @@ find the \code{eggs} variable.
complex number, its magnitude is returned. complex number, its magnitude is returned.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{apply}{function\, args\optional{, keywords}} \begin{funcdesc}{apply}{function, args\optional{, keywords}}
The \var{function} argument must be a callable object (a user-defined or The \var{function} argument must be a callable object (a user-defined or
built-in function or method, or a class object) and the \var{args} built-in function or method, or a class object) and the \var{args}
argument must be a tuple. The \var{function} is called with argument must be a tuple. The \var{function} is called with
@ -82,20 +82,20 @@ class instances are callable if they have a \method{__call__()} method.
inclusive. inclusive.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{cmp}{x\, y} \begin{funcdesc}{cmp}{x, y}
Compare the two objects \var{x} and \var{y} and return an integer Compare the two objects \var{x} and \var{y} and return an integer
according to the outcome. The return value is negative if \code{\var{x} according to the outcome. The return value is negative if \code{\var{x}
< \var{y}}, zero if \code{\var{x} == \var{y}} and strictly positive if < \var{y}}, zero if \code{\var{x} == \var{y}} and strictly positive if
\code{\var{x} > \var{y}}. \code{\var{x} > \var{y}}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{coerce}{x\, y} \begin{funcdesc}{coerce}{x, y}
Return a tuple consisting of the two numeric arguments converted to Return a tuple consisting of the two numeric arguments converted to
a common type, using the same rules as used by arithmetic a common type, using the same rules as used by arithmetic
operations. operations.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{compile}{string\, filename\, kind} \begin{funcdesc}{compile}{string, filename, kind}
Compile the \var{string} into a code object. Code objects can be Compile the \var{string} into a code object. Code objects can be
executed by an \keyword{exec} statement or evaluated by a call to executed by an \keyword{exec} statement or evaluated by a call to
\function{eval()}. The \var{filename} argument should \function{eval()}. The \var{filename} argument should
@ -117,7 +117,7 @@ class instances are callable if they have a \method{__call__()} method.
\function{long()} and \function{float()}. \function{long()} and \function{float()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{delattr}{object\, name} \begin{funcdesc}{delattr}{object, name}
This is a relative of \function{setattr()}. The arguments are an This is a relative of \function{setattr()}. The arguments are an
object and a string. The string must be the name object and a string. The string must be the name
of one of the object's attributes. The function deletes of one of the object's attributes. The function deletes
@ -146,7 +146,7 @@ class instances are callable if they have a \method{__call__()} method.
\end{verbatim} \end{verbatim}
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{divmod}{a\, b} \begin{funcdesc}{divmod}{a, b}
Take two numbers as arguments and return a pair of numbers consisting Take two numbers as arguments and return a pair of numbers consisting
of their quotient and remainder when using long division. With mixed of their quotient and remainder when using long division. With mixed
operand types, the rules for binary arithmetic operators apply. For operand types, the rules for binary arithmetic operators apply. For
@ -156,7 +156,7 @@ class instances are callable if they have a \method{__call__()} method.
\code{(math.floor(\var{a} / \var{b}), \var{a} \%{} \var{b})}. \code{(math.floor(\var{a} / \var{b}), \var{a} \%{} \var{b})}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{eval}{expression\optional{\, globals\optional{\, locals}}} \begin{funcdesc}{eval}{expression\optional{, globals\optional{, locals}}}
The arguments are a string and two optional dictionaries. The The arguments are a string and two optional dictionaries. The
\var{expression} argument is parsed and evaluated as a Python \var{expression} argument is parsed and evaluated as a Python
expression (technically speaking, a condition list) using the expression (technically speaking, a condition list) using the
@ -188,7 +188,7 @@ class instances are callable if they have a \method{__call__()} method.
\function{execfile()}. \function{execfile()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{execfile}{file\optional{\, globals\optional{\, locals}}} \begin{funcdesc}{execfile}{file\optional{, globals\optional{, locals}}}
This function is similar to the This function is similar to the
\keyword{exec} statement, but parses a file instead of a string. It \keyword{exec} statement, but parses a file instead of a string. It
is different from the \keyword{import} statement in that it does not is different from the \keyword{import} statement in that it does not
@ -206,7 +206,7 @@ class instances are callable if they have a \method{__call__()} method.
\code{None}. \code{None}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{filter}{function\, list} \begin{funcdesc}{filter}{function, list}
Construct a list from those elements of \var{list} for which Construct a list from those elements of \var{list} for which
\var{function} returns true. If \var{list} is a string or a tuple, \var{function} returns true. If \var{list} is a string or a tuple,
the result also has that type; otherwise it is always a list. If the result also has that type; otherwise it is always a list. If
@ -226,7 +226,7 @@ removed.
returned. returned.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{getattr}{object\, name} \begin{funcdesc}{getattr}{object, name}
The arguments are an object and a string. The string must be the The arguments are an object and a string. The string must be the
name of one of the object's attributes. The result is the value of name of one of the object's attributes. The result is the value of
that attribute. For example, \code{getattr(\var{x}, that attribute. For example, \code{getattr(\var{x},
@ -240,7 +240,7 @@ function or method, this is the module where it is defined, not the
module from which it is called). module from which it is called).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{hasattr}{object\, name} \begin{funcdesc}{hasattr}{object, name}
The arguments are an object and a string. The result is 1 if the The arguments are an object and a string. The result is 1 if the
string is the name of one of the object's attributes, 0 if not. string is the name of one of the object's attributes, 0 if not.
(This is implemented by calling \code{getattr(\var{object}, (This is implemented by calling \code{getattr(\var{object},
@ -355,7 +355,7 @@ desired effect.
see the description of \function{int()}. see the description of \function{int()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{map}{function\, list\, ...} \begin{funcdesc}{map}{function, list, ...}
Apply \var{function} to every item of \var{list} and return a list Apply \var{function} to every item of \var{list} and return a list
of the results. If additional \var{list} arguments are passed, of the results. If additional \var{list} arguments are passed,
\var{function} must take that many arguments and is applied to \var{function} must take that many arguments and is applied to
@ -388,7 +388,7 @@ any kind of sequence; the result is always a list.
\exception{OverflowError} exception. \exception{OverflowError} exception.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{open}{filename\optional{\, mode\optional{\, bufsize}}} \begin{funcdesc}{open}{filename\optional{, mode\optional{, bufsize}}}
Return a new file object (described earlier under Built-in Types). Return a new file object (described earlier under Built-in Types).
The first two arguments are the same as for \code{stdio}'s The first two arguments are the same as for \code{stdio}'s
\cfunction{fopen()}: \var{filename} is the file name to be opened, \cfunction{fopen()}: \var{filename} is the file name to be opened,
@ -423,7 +423,7 @@ there's no reliable way to determine whether this is the case.}
\function{chr()}. \function{chr()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{pow}{x\, y\optional{\, z}} \begin{funcdesc}{pow}{x, y\optional{, z}}
Return \var{x} to the power \var{y}; if \var{z} is present, return Return \var{x} to the power \var{y}; if \var{z} is present, return
\var{x} to the power \var{y}, modulo \var{z} (computed more \var{x} to the power \var{y}, modulo \var{z} (computed more
efficiently than \code{pow(\var{x}, \var{y}) \% \var{z}}). efficiently than \code{pow(\var{x}, \var{y}) \% \var{z}}).
@ -435,7 +435,7 @@ there's no reliable way to determine whether this is the case.}
35000)} is not allowed. 35000)} is not allowed.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{range}{\optional{start\,} stop\optional{\, step}} \begin{funcdesc}{range}{\optional{start,} stop\optional{, step}}
This is a versatile function to create lists containing arithmetic This is a versatile function to create lists containing arithmetic
progressions. It is most often used in \keyword{for} loops. The progressions. It is most often used in \keyword{for} loops. The
arguments must be plain integers. If the \var{step} argument is arguments must be plain integers. If the \var{step} argument is
@ -487,7 +487,7 @@ If the \module{readline} module was loaded, then
line editing and history features. line editing and history features.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{reduce}{function\, list\optional{\, initializer}} \begin{funcdesc}{reduce}{function, list\optional{, initializer}}
Apply the binary \var{function} to the items of \var{list} so as to Apply the binary \var{function} to the items of \var{list} so as to
reduce the list to a single value. E.g., reduce the list to a single value. E.g.,
\code{reduce(lambda x, y: x*y, \var{list}, 1)} returns the product of \code{reduce(lambda x, y: x*y, \var{list}, 1)} returns the product of
@ -551,7 +551,7 @@ to return a string that would yield an object with the same value
when passed to \function{eval()}. when passed to \function{eval()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{round}{x\, n} \begin{funcdesc}{round}{x, n}
Return the floating point value \var{x} rounded to \var{n} digits Return the floating point value \var{x} rounded to \var{n} digits
after the decimal point. If \var{n} is omitted, it defaults to zero. after the decimal point. If \var{n} is omitted, it defaults to zero.
The result is a floating point number. Values are rounded to the The result is a floating point number. Values are rounded to the
@ -560,7 +560,7 @@ when passed to \function{eval()}.
\code{round(0.5)} is \code{1.0} and \code{round(-0.5)} is \code{-1.0}). \code{round(0.5)} is \code{1.0} and \code{round(-0.5)} is \code{-1.0}).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setattr}{object\, name\, value} \begin{funcdesc}{setattr}{object, name, value}
This is the counterpart of \function{getattr()}. The arguments are an This is the counterpart of \function{getattr()}. The arguments are an
object, a string and an arbitrary value. The string must be the name object, a string and an arbitrary value. The string must be the name
of one of the object's attributes. The function assigns the value to of one of the object's attributes. The function assigns the value to
@ -569,7 +569,7 @@ when passed to \function{eval()}.
\code{\var{x}.\var{foobar} = 123}. \code{\var{x}.\var{foobar} = 123}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{slice}{\optional{start\,} stop\optional{\, step}} \begin{funcdesc}{slice}{\optional{start,} stop\optional{, step}}
Return a slice object representing the set of indices specified by Return a slice object representing the set of indices specified by
\code{range(\var{start}, \var{stop}, \var{step})}. The \var{start} \code{range(\var{start}, \var{stop}, \var{step})}. The \var{start}
and \var{step} arguments default to None. Slice objects have and \var{step} arguments default to None. Slice objects have
@ -623,7 +623,7 @@ cannot normally be affected this way, but variables retrieved from
other scopes (e.g. modules) can be. This may change.} other scopes (e.g. modules) can be. This may change.}
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{xrange}{\optional{start\,} stop\optional{\, step}} \begin{funcdesc}{xrange}{\optional{start,} stop\optional{, step}}
This function is very similar to \function{range()}, but returns an This function is very similar to \function{range()}, but returns an
``xrange object'' instead of a list. This is an opaque sequence type ``xrange object'' instead of a list. This is an opaque sequence type
which yields the same values as the corresponding list, without which yields the same values as the corresponding list, without

View file

@ -35,7 +35,7 @@ Raised on \code{gdbm}-specific errors, such as I/O errors. \code{KeyError} is
raised for general mapping errors like specifying an incorrect key. raised for general mapping errors like specifying an incorrect key.
\end{excdesc} \end{excdesc}
\begin{funcdesc}{open}{filename\, \optional{flag\, \optional{mode}}} \begin{funcdesc}{open}{filename, \optional{flag, \optional{mode}}}
Open a \code{gdbm} database and return a \code{gdbm} object. The Open a \code{gdbm} database and return a \code{gdbm} object. The
\var{filename} argument is the name of the database file. \var{filename} argument is the name of the database file.

View file

@ -119,7 +119,7 @@ Similar to
but the pairs have the point first and the normal second. but the pairs have the point first and the normal second.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{nurbssurface}{s_k\, t_k\, ctl\, s_ord\, t_ord\, type} \begin{funcdesc}{nurbssurface}{s_k, t_k, ctl, s_ord, t_ord, type}
% XXX s_k[], t_k[], ctl[][] % XXX s_k[], t_k[], ctl[][]
Defines a nurbs surface. Defines a nurbs surface.
The dimensions of The dimensions of
@ -129,13 +129,13 @@ are computed as follows:
\code{[len(\var{t_k}) - \var{t_ord}]}. \code{[len(\var{t_k}) - \var{t_ord}]}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{nurbscurve}{knots\, ctlpoints\, order\, type} \begin{funcdesc}{nurbscurve}{knots, ctlpoints, order, type}
Defines a nurbs curve. Defines a nurbs curve.
The length of ctlpoints is The length of ctlpoints is
\code{len(\var{knots}) - \var{order}}. \code{len(\var{knots}) - \var{order}}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{pwlcurve}{points\, type} \begin{funcdesc}{pwlcurve}{points, type}
Defines a piecewise-linear curve. Defines a piecewise-linear curve.
\var{points} \var{points}
is a list of points. is a list of points.

View file

@ -86,7 +86,7 @@ affects the operation of \method{handle_data()} and \method{save_end()}.
\setindexsubitem{(HTMLParser method)} \setindexsubitem{(HTMLParser method)}
\begin{funcdesc}{anchor_bgn}{href\, name\, type} \begin{funcdesc}{anchor_bgn}{href, name, type}
This method is called at the start of an anchor region. The arguments This method is called at the start of an anchor region. The arguments
correspond to the attributes of the \code{<A>} tag with the same correspond to the attributes of the \code{<A>} tag with the same
names. The default implementation maintains a list of hyperlinks names. The default implementation maintains a list of hyperlinks
@ -100,7 +100,7 @@ implementation adds a textual footnote marker using an index into the
list of hyperlinks created by \method{anchor_bgn()}. list of hyperlinks created by \method{anchor_bgn()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{handle_image}{source\, alt\optional{\, ismap\optional{\, align\optional{\, width\optional{\, height}}}}} \begin{funcdesc}{handle_image}{source, alt\optional{, ismap\optional{, align\optional{, width\optional{, height}}}}}
This method is called to handle images. The default implementation This method is called to handle images. The default implementation
simply passes the \var{alt} value to the \method{handle_data()} simply passes the \var{alt} value to the \method{handle_data()}
method. method.

View file

@ -17,7 +17,7 @@ per pixel, etc.
\end{excdesc} \end{excdesc}
\begin{funcdesc}{crop}{image\, psize\, width\, height\, x0\, y0\, x1\, y1} \begin{funcdesc}{crop}{image, psize, width, height, x0, y0, x1, y1}
Return the selected part of \var{image}, which should by Return the selected part of \var{image}, which should by
\var{width} by \var{height} in size and consist of pixels of \var{width} by \var{height} in size and consist of pixels of
\var{psize} bytes. \var{x0}, \var{y0}, \var{x1} and \var{y1} are like \var{psize} bytes. \var{x0}, \var{y0}, \var{x1} and \var{y1} are like
@ -28,14 +28,14 @@ that fall outside the old image will have their value set to zero. If
holds for the y coordinates. holds for the y coordinates.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{scale}{image\, psize\, width\, height\, newwidth\, newheight} \begin{funcdesc}{scale}{image, psize, width, height, newwidth, newheight}
Return \var{image} scaled to size \var{newwidth} by \var{newheight}. Return \var{image} scaled to size \var{newwidth} by \var{newheight}.
No interpolation is done, scaling is done by simple-minded pixel No interpolation is done, scaling is done by simple-minded pixel
duplication or removal. Therefore, computer-generated images or duplication or removal. Therefore, computer-generated images or
dithered images will not look nice after scaling. dithered images will not look nice after scaling.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{tovideo}{image\, psize\, width\, height} \begin{funcdesc}{tovideo}{image, psize, width, height}
Run a vertical low-pass filter over an image. It does so by computing Run a vertical low-pass filter over an image. It does so by computing
each destination pixel as the average of two vertically-aligned source each destination pixel as the average of two vertically-aligned source
pixels. The main use of this routine is to forestall excessive pixels. The main use of this routine is to forestall excessive
@ -43,18 +43,18 @@ flicker if the image is displayed on a video device that uses
interlacing, hence the name. interlacing, hence the name.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{grey2mono}{image\, width\, height\, threshold} \begin{funcdesc}{grey2mono}{image, width, height, threshold}
Convert a 8-bit deep greyscale image to a 1-bit deep image by Convert a 8-bit deep greyscale image to a 1-bit deep image by
tresholding all the pixels. The resulting image is tightly packed and tresholding all the pixels. The resulting image is tightly packed and
is probably only useful as an argument to \code{mono2grey}. is probably only useful as an argument to \code{mono2grey}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{dither2mono}{image\, width\, height} \begin{funcdesc}{dither2mono}{image, width, height}
Convert an 8-bit greyscale image to a 1-bit monochrome image using a Convert an 8-bit greyscale image to a 1-bit monochrome image using a
(simple-minded) dithering algorithm. (simple-minded) dithering algorithm.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{mono2grey}{image\, width\, height\, p0\, p1} \begin{funcdesc}{mono2grey}{image, width, height, p0, p1}
Convert a 1-bit monochrome image to an 8 bit greyscale or color image. Convert a 1-bit monochrome image to an 8 bit greyscale or color image.
All pixels that are zero-valued on input get value \var{p0} on output All pixels that are zero-valued on input get value \var{p0} on output
and all one-value input pixels get value \var{p1} on output. To and all one-value input pixels get value \var{p1} on output. To
@ -62,26 +62,26 @@ convert a monochrome black-and-white image to greyscale pass the
values \code{0} and \code{255} respectively. values \code{0} and \code{255} respectively.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{grey2grey4}{image\, width\, height} \begin{funcdesc}{grey2grey4}{image, width, height}
Convert an 8-bit greyscale image to a 4-bit greyscale image without Convert an 8-bit greyscale image to a 4-bit greyscale image without
dithering. dithering.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{grey2grey2}{image\, width\, height} \begin{funcdesc}{grey2grey2}{image, width, height}
Convert an 8-bit greyscale image to a 2-bit greyscale image without Convert an 8-bit greyscale image to a 2-bit greyscale image without
dithering. dithering.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{dither2grey2}{image\, width\, height} \begin{funcdesc}{dither2grey2}{image, width, height}
Convert an 8-bit greyscale image to a 2-bit greyscale image with Convert an 8-bit greyscale image to a 2-bit greyscale image with
dithering. As for \code{dither2mono}, the dithering algorithm is dithering. As for \code{dither2mono}, the dithering algorithm is
currently very simple. currently very simple.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{grey42grey}{image\, width\, height} \begin{funcdesc}{grey42grey}{image, width, height}
Convert a 4-bit greyscale image to an 8-bit greyscale image. Convert a 4-bit greyscale image to an 8-bit greyscale image.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{grey22grey}{image\, width\, height} \begin{funcdesc}{grey22grey}{image, width, height}
Convert a 2-bit greyscale image to an 8-bit greyscale image. Convert a 2-bit greyscale image to an 8-bit greyscale image.
\end{funcdesc} \end{funcdesc}

View file

@ -30,7 +30,7 @@ the string. This format is suitable to pass to \code{gl.lrectwrite},
for instance. for instance.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{readscaled}{file\, x\, y\, filter\optional{\, blur}} \begin{funcdesc}{readscaled}{file, x, y, filter\optional{, blur}}
This function is identical to read but it returns an image that is This function is identical to read but it returns an image that is
scaled to the given \var{x} and \var{y} sizes. If the \var{filter} and scaled to the given \var{x} and \var{y} sizes. If the \var{filter} and
\var{blur} parameters are omitted scaling is done by \var{blur} parameters are omitted scaling is done by
@ -55,7 +55,7 @@ compatible with SGI GL) or from top to bottom(flag is one,
compatible with X). The default is zero. compatible with X). The default is zero.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{write}{file\, data\, x\, y\, z} \begin{funcdesc}{write}{file, data, x, y, z}
This function writes the RGB or greyscale data in \var{data} to image This function writes the RGB or greyscale data in \var{data} to image
file \var{file}. \var{x} and \var{y} give the size of the image, file \var{file}. \var{x} and \var{y} give the size of the image,
\var{z} is 1 for 1 byte greyscale images or 3 for RGB images (which are \var{z} is 1 for 1 byte greyscale images or 3 for RGB images (which are

View file

@ -188,7 +188,7 @@ shared libraries is highly system dependent, and not all systems
support it.) support it.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{load_source}{name\, pathname\, file} \begin{funcdesc}{load_source}{name, pathname, file}
Load and initialize a module implemented as a Python source file and Load and initialize a module implemented as a Python source file and
return its module object. If the module was already initialized, it return its module object. If the module was already initialized, it
will be initialized \emph{again}. The \var{name} argument is used to will be initialized \emph{again}. The \var{name} argument is used to

View file

@ -95,7 +95,7 @@ displayed in inverse video (this disables the upper half of a
non-\ASCII{} character set). non-\ASCII{} character set).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{gotoxy}{x\, y} \begin{funcdesc}{gotoxy}{x, y}
Set the cursor to position \code{(\var{x}, \var{y})}. Set the cursor to position \code{(\var{x}, \var{y})}.
\end{funcdesc} \end{funcdesc}

View file

@ -2,16 +2,16 @@
\label{module-macfs} \label{module-macfs}
\bimodindex{macfs} \bimodindex{macfs}
\setindexsubitem{(in module macfs)}
This module provides access to macintosh FSSpec handling, the Alias This module provides access to Macintosh FSSpec handling, the Alias
Manager, finder aliases and the Standard File package. Manager, finder aliases and the Standard File package.
Whenever a function or method expects a \var{file} argument, this Whenever a function or method expects a \var{file} argument, this
argument can be one of three things:\ (1) a full or partial Macintosh argument can be one of three things:\ (1) a full or partial Macintosh
pathname, (2) an FSSpec object or (3) a 3-tuple \code{(wdRefNum, pathname, (2) an FSSpec object or (3) a 3-tuple \code{(\var{wdRefNum},
parID, name)} as described in Inside Mac VI\@. A description of aliases \var{parID}, \var{name})} as described in \emph{Inside Macintosh
and the standard file package can also be found there. VI}\@. A description of aliases and the standard file package can also
be found there.
\begin{funcdesc}{FSSpec}{file} \begin{funcdesc}{FSSpec}{file}
Create an FSSpec object for the specified file. Create an FSSpec object for the specified file.
@ -41,7 +41,7 @@ Resolve an alias file. Returns a 3-tuple \code{(\var{fsspec}, \var{isfolder},
(otherwise the FSSpec object for the file itself is returned). (otherwise the FSSpec object for the file itself is returned).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{StandardGetFile}{\optional{type\, ...}} \begin{funcdesc}{StandardGetFile}{\optional{type, ...}}
Present the user with a standard ``open input file'' Present the user with a standard ``open input file''
dialog. Optionally, you can pass up to four 4-char file types to limit dialog. Optionally, you can pass up to four 4-char file types to limit
the files the user can choose from. The function returns an FSSpec the files the user can choose from. The function returns an FSSpec
@ -49,11 +49,11 @@ object and a flag indicating that the user completed the dialog
without cancelling. without cancelling.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{PromptGetFile}{prompt\optional{\, type\, ...}} \begin{funcdesc}{PromptGetFile}{prompt\optional{, type, ...}}
Similar to \var{StandardGetFile} but allows you to specify a prompt. Similar to \var{StandardGetFile} but allows you to specify a prompt.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{StandardPutFile}{prompt\, \optional{default}} \begin{funcdesc}{StandardPutFile}{prompt, \optional{default}}
Present the user with a standard ``open output file'' Present the user with a standard ``open output file''
dialog. \var{prompt} is the prompt string, and the optional dialog. \var{prompt} is the prompt string, and the optional
\var{default} argument initializes the output file name. The function \var{default} argument initializes the output file name. The function
@ -79,7 +79,7 @@ behaviour with the ``general controls'' controlpanel, thereby making
this call inoperative. this call inoperative.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{FindFolder}{where\, which\, create} \begin{funcdesc}{FindFolder}{where, which, create}
Locates one of the ``special'' folders that MacOS knows about, such as Locates one of the ``special'' folders that MacOS knows about, such as
the trash or the Preferences folder. \var{Where} is the disk to the trash or the Preferences folder. \var{Where} is the disk to
search, \var{which} is the 4-char string specifying which folder to search, \var{which} is the 4-char string specifying which folder to
@ -133,7 +133,7 @@ Create a minimal alias pointing to this file.
Return the 4-char creator and type of the file. Return the 4-char creator and type of the file.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{SetCreatorType}{creator\, type} \begin{funcdesc}{SetCreatorType}{creator, type}
Set the 4-char creator and type of the file. Set the 4-char creator and type of the file.
\end{funcdesc} \end{funcdesc}
@ -151,7 +151,7 @@ Return a tuple with three floating point values representing the
creation date, modification date and backup date of the file. creation date, modification date and backup date of the file.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{SetDates}{crdate\, moddate\, backupdate} \begin{funcdesc}{SetDates}{crdate, moddate, backupdate}
Set the creation, modification and backup date of the file. The values Set the creation, modification and backup date of the file. The values
are in the standard floating point format used for times throughout are in the standard floating point format used for times throughout
Python. Python.
@ -179,7 +179,7 @@ is returned.
An interface to the C routine \code{GetAliasInfo()}. An interface to the C routine \code{GetAliasInfo()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{Update}{file\, \optional{file2}} \begin{funcdesc}{Update}{file, \optional{file2}}
Update the alias to point to the \var{file} given. If \var{file2} is Update the alias to point to the \var{file} given. If \var{file2} is
present a relative alias will be created. present a relative alias will be created.
\end{funcdesc} \end{funcdesc}

View file

@ -9,7 +9,7 @@ The \code{macostools} module defines the following functions:
\setindexsubitem{(in module macostools)} \setindexsubitem{(in module macostools)}
\begin{funcdesc}{copy}{src\, dst\optional{\, createpath, copytimes}} \begin{funcdesc}{copy}{src, dst\optional{, createpath, copytimes}}
Copy file \var{src} to \var{dst}. The files can be specified as Copy file \var{src} to \var{dst}. The files can be specified as
pathnames or \code{FSSpec} objects. If \var{createpath} is non-zero pathnames or \code{FSSpec} objects. If \var{createpath} is non-zero
\var{dst} must be a pathname and the folders leading to the \var{dst} must be a pathname and the folders leading to the
@ -22,13 +22,13 @@ If the source is an alias the original to which the alias points is
copied, not the aliasfile. copied, not the aliasfile.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{copytree}{src\, dst} \begin{funcdesc}{copytree}{src, dst}
Recursively copy a file tree from \var{src} to \var{dst}, creating Recursively copy a file tree from \var{src} to \var{dst}, creating
folders as needed. \var{Src} and \var{dst} should be specified as folders as needed. \var{Src} and \var{dst} should be specified as
pathnames. pathnames.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{mkalias}{src\, dst} \begin{funcdesc}{mkalias}{src, dst}
Create a finder alias \var{dst} pointing to \var{src}. Both may be Create a finder alias \var{dst} pointing to \var{src}. Both may be
specified as pathnames or \var{FSSpec} objects. specified as pathnames or \var{FSSpec} objects.
\end{funcdesc} \end{funcdesc}

View file

@ -78,13 +78,13 @@ Return the TCP address of this side of a connection as a 2-tuple
\code{(host, port)}, both integers. \code{(host, port)}, both integers.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{ActiveOpen}{lport\, host\, rport} \begin{funcdesc}{ActiveOpen}{lport, host, rport}
Open an outgoing connection to TCP address \code{(\var{host}, \var{rport})}. Use Open an outgoing connection to TCP address \code{(\var{host}, \var{rport})}. Use
local port \var{lport} (zero makes the system pick a free port). This local port \var{lport} (zero makes the system pick a free port). This
call blocks until the connection has been established. call blocks until the connection has been established.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{Send}{buf\, push\, urgent} \begin{funcdesc}{Send}{buf, push, urgent}
Send data \var{buf} over the connection. \var{Push} and \var{urgent} Send data \var{buf} over the connection. \var{Push} and \var{urgent}
are flags as specified by the TCP standard. are flags as specified by the TCP standard.
\end{funcdesc} \end{funcdesc}
@ -168,7 +168,7 @@ Read a datagram, waiting at most \var{timeout} seconds (-1 is
infinite). Return the data. infinite). Return the data.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{Write}{host\, port\, buf} \begin{funcdesc}{Write}{host, port, buf}
Send \var{buf} as a datagram to IP-address \var{host}, port Send \var{buf} as a datagram to IP-address \var{host}, port
\var{port}. \var{port}.
\end{funcdesc} \end{funcdesc}

View file

@ -18,7 +18,7 @@ most 255 characters long, is displayed. Control is returned when the
user clicks ``OK''. user clicks ``OK''.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{AskString}{prompt\optional{\, default}} \begin{funcdesc}{AskString}{prompt\optional{, default}}
Ask the user to input a string value, in a modal dialog. \var{Prompt} Ask the user to input a string value, in a modal dialog. \var{Prompt}
is the promt message, the optional \var{default} arg is the initial is the promt message, the optional \var{default} arg is the initial
value for the string. All strings can be at most 255 bytes value for the string. All strings can be at most 255 bytes
@ -26,7 +26,7 @@ long. \var{AskString} returns the string entered or \code{None} in
case the user cancelled. case the user cancelled.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{AskYesNoCancel}{question\optional{\, default}} \begin{funcdesc}{AskYesNoCancel}{question\optional{, default}}
Present a dialog with text \var{question} and three buttons labelled Present a dialog with text \var{question} and three buttons labelled
``yes'', ``no'' and ``cancel''. Return \code{1} for yes, \code{0} for ``yes'', ``no'' and ``cancel''. Return \code{1} for yes, \code{0} for
no and \code{-1} for cancel. The default return value chosen by no and \code{-1} for cancel. The default return value chosen by
@ -34,7 +34,7 @@ hitting return is \code{0}. This can be changed with the optional
\var{default} argument. \var{default} argument.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{ProgressBar}{\optional{label\, maxval}} \begin{funcdesc}{ProgressBar}{\optional{label, maxval}}
Display a modeless progress dialog with a thermometer bar. \var{Label} Display a modeless progress dialog with a thermometer bar. \var{Label}
is the textstring displayed (default ``Working...''), \var{maxval} is is the textstring displayed (default ``Working...''), \var{maxval} is
the value at which progress is complete (default 100). The returned the value at which progress is complete (default 100). The returned

View file

@ -17,7 +17,7 @@ Configuration Mechanism For Multimedia Mail Format Information,'' but
is not an Internet standard. However, mailcap files are supported on is not an Internet standard. However, mailcap files are supported on
most \UNIX{} systems. most \UNIX{} systems.
\begin{funcdesc}{findmatch}{caps\, MIMEtype\, key\, filename\, plist} \begin{funcdesc}{findmatch}{caps, MIMEtype, key, filename, plist}
Return a 2-tuple; the first element is a string containing the command Return a 2-tuple; the first element is a string containing the command
line to be executed line to be executed
(which can be passed to \code{os.system()}), and the second element is (which can be passed to \code{os.system()}), and the second element is

View file

@ -30,18 +30,18 @@ object \var{input} and write the decoded data to open file object
\code{'base64'}, \code{'quoted-printable'} and \code{'uuencode'}. \code{'base64'}, \code{'quoted-printable'} and \code{'uuencode'}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{encode}{input\, output\, encoding} \begin{funcdesc}{encode}{input, output, encoding}
Read data from open file object \var{input} and write it encoded using Read data from open file object \var{input} and write it encoded using
the allowed MIME \var{encoding} to open file object \var{output}. the allowed MIME \var{encoding} to open file object \var{output}.
Valid values for \var{encoding} are the same as for \method{decode()}. Valid values for \var{encoding} are the same as for \method{decode()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{copyliteral}{input\, output} \begin{funcdesc}{copyliteral}{input, output}
Read lines until \EOF{} from open file \var{input} and write them to Read lines until \EOF{} from open file \var{input} and write them to
open file \var{output}. open file \var{output}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{copybinary}{input\, output} \begin{funcdesc}{copybinary}{input, output}
Read blocks until \EOF{} from open file \var{input} and write them to Read blocks until \EOF{} from open file \var{input} and write them to
open file \var{output}. The block size is currently fixed at 8192. open file \var{output}. The block size is currently fixed at 8192.
\end{funcdesc} \end{funcdesc}

View file

@ -36,14 +36,14 @@ provide its own windows, etc.
\setindexsubitem{(AEServer method)} \setindexsubitem{(AEServer method)}
\begin{funcdesc}{installaehandler}{classe\, type\, callback} \begin{funcdesc}{installaehandler}{classe, type, callback}
Installs an AppleEvent handler. \code{Classe} and \code{type} are the Installs an AppleEvent handler. \code{Classe} and \code{type} are the
four-char OSA Class and Type designators, \code{'****'} wildcards are four-char OSA Class and Type designators, \code{'****'} wildcards are
allowed. When a matching AppleEvent is received the parameters are allowed. When a matching AppleEvent is received the parameters are
decoded and your callback is invoked. decoded and your callback is invoked.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{callback}{_object\, **kwargs} \begin{funcdesc}{callback}{_object, **kwargs}
Your callback is called with the OSA Direct Object as first positional Your callback is called with the OSA Direct Object as first positional
parameter. The other parameters are passed as keyword arguments, with parameter. The other parameters are passed as keyword arguments, with
the 4-char designator as name. Three extra keyword parameters are the 4-char designator as name. Three extra keyword parameters are

View file

@ -37,17 +37,17 @@ A number of \emph{extra} functions are defined in this module. Non
mpz-arguments are converted to mpz-values first, and the functions mpz-arguments are converted to mpz-values first, and the functions
return mpz-numbers. return mpz-numbers.
\begin{funcdesc}{powm}{base\, exponent\, modulus} \begin{funcdesc}{powm}{base, exponent, modulus}
Return \code{pow(\var{base}, \var{exponent}) \%{} \var{modulus}}. If Return \code{pow(\var{base}, \var{exponent}) \%{} \var{modulus}}. If
\code{\var{exponent} == 0}, return \code{mpz(1)}. In contrast to the \code{\var{exponent} == 0}, return \code{mpz(1)}. In contrast to the
\C-library function, this version can handle negative exponents. \C-library function, this version can handle negative exponents.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{gcd}{op1\, op2} \begin{funcdesc}{gcd}{op1, op2}
Return the greatest common divisor of \var{op1} and \var{op2}. Return the greatest common divisor of \var{op1} and \var{op2}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{gcdext}{a\, b} \begin{funcdesc}{gcdext}{a, b}
Return a tuple \code{(\var{g}, \var{s}, \var{t})}, such that Return a tuple \code{(\var{g}, \var{s}, \var{t})}, such that
\code{\var{a}*\var{s} + \var{b}*\var{t} == \var{g} == gcd(\var{a}, \var{b})}. \code{\var{a}*\var{s} + \var{b}*\var{t} == \var{g} == gcd(\var{a}, \var{b})}.
\end{funcdesc} \end{funcdesc}
@ -61,7 +61,7 @@ return mpz-numbers.
\code{\var{root}*\var{root} + \var{remainder} == \var{op}}. \code{\var{root}*\var{root} + \var{remainder} == \var{op}}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{divm}{numerator\, denominator\, modulus} \begin{funcdesc}{divm}{numerator, denominator, modulus}
Returns a number \var{q}. such that Returns a number \var{q}. such that
\code{\var{q} * \var{denominator} \%{} \var{modulus} == \var{numerator}}. \code{\var{q} * \var{denominator} \%{} \var{modulus} == \var{numerator}}.
One could also implement this function in Python, using \code{gcdext}. One could also implement this function in Python, using \code{gcdext}.

View file

@ -153,7 +153,7 @@ converted to parse trees represented as list- or tuple- trees, or may
be compiled into executable code objects. Parse trees may be be compiled into executable code objects. Parse trees may be
extracted with or without line numbering information. extracted with or without line numbering information.
\begin{funcdesc}{ast2list}{ast\optional{\, line_info\code{ = 0}}} \begin{funcdesc}{ast2list}{ast\optional{, line_info\code{ = 0}}}
This function accepts an AST object from the caller in This function accepts an AST object from the caller in
\code{\var{ast}} and returns a Python list representing the \code{\var{ast}} and returns a Python list representing the
equivelent parse tree. The resulting list representation can be used equivelent parse tree. The resulting list representation can be used
@ -172,7 +172,7 @@ the line on which the token \emph{ends}. This information is
omitted if the flag is false or omitted. omitted if the flag is false or omitted.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{ast2tuple}{ast\optional{\, line_info\code{ = 0}}} \begin{funcdesc}{ast2tuple}{ast\optional{, line_info\code{ = 0}}}
This function accepts an AST object from the caller in This function accepts an AST object from the caller in
\code{\var{ast}} and returns a Python tuple representing the \code{\var{ast}} and returns a Python tuple representing the
equivelent parse tree. Other than returning a tuple instead of a equivelent parse tree. Other than returning a tuple instead of a
@ -184,7 +184,7 @@ representing the token. This information is omitted if the flag is
false or omitted. false or omitted.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{compileast}{ast\optional{\, filename\code{ = '<ast>'}}} \begin{funcdesc}{compileast}{ast\optional{, filename\code{ = '<ast>'}}}
The Python byte compiler can be invoked on an AST object to produce The Python byte compiler can be invoked on an AST object to produce
code objects which can be used as part of an \code{exec} statement or code objects which can be used as part of an \code{exec} statement or
a call to the built-in \function{eval()}\bifuncindex{eval} function. a call to the built-in \function{eval()}\bifuncindex{eval} function.

View file

@ -69,7 +69,7 @@ NameError: spam
The module defines the following functions; each enters the debugger The module defines the following functions; each enters the debugger
in a slightly different way: in a slightly different way:
\begin{funcdesc}{run}{statement\optional{\, globals\optional{\, locals}}} \begin{funcdesc}{run}{statement\optional{, globals\optional{, locals}}}
Execute the \var{statement} (given as a string) under debugger Execute the \var{statement} (given as a string) under debugger
control. The debugger prompt appears before any code is executed; you control. The debugger prompt appears before any code is executed; you
can set breakpoints and type \code{continue}, or you can step through can set breakpoints and type \code{continue}, or you can step through
@ -81,14 +81,14 @@ the explanation of the \code{exec} statement or the \code{eval()}
built-in function.) built-in function.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{runeval}{expression\optional{\, globals\optional{\, locals}}} \begin{funcdesc}{runeval}{expression\optional{, globals\optional{, locals}}}
Evaluate the \var{expression} (given as a a string) under debugger Evaluate the \var{expression} (given as a a string) under debugger
control. When \code{runeval()} returns, it returns the value of the control. When \code{runeval()} returns, it returns the value of the
expression. Otherwise this function is similar to expression. Otherwise this function is similar to
\code{run()}. \code{run()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{runcall}{function\optional{\, argument\, ...}} \begin{funcdesc}{runcall}{function\optional{, argument, ...}}
Call the \var{function} (a function or method object, not a string) Call the \var{function} (a function or method object, not a string)
with the given arguments. When \code{runcall()} returns, it returns with the given arguments. When \code{runcall()} returns, it returns
whatever the function call returned. The debugger prompt appears as whatever the function call returned. The debugger prompt appears as

View file

@ -229,7 +229,7 @@ Collection may also become a problem here.)
Apart from the \code{Pickler} and \code{Unpickler} classes, the Apart from the \code{Pickler} and \code{Unpickler} classes, the
module defines the following functions, and an exception: module defines the following functions, and an exception:
\begin{funcdesc}{dump}{object\, file\optional{, bin}} \begin{funcdesc}{dump}{object, file\optional{, bin}}
Write a pickled representation of \var{obect} to the open file object Write a pickled representation of \var{obect} to the open file object
\var{file}. This is equivalent to \var{file}. This is equivalent to
\code{Pickler(\var{file}, \var{bin}).dump(\var{object})}. \code{Pickler(\var{file}, \var{bin}).dump(\var{object})}.

View file

@ -79,11 +79,11 @@ It defines the following functions and constants:
Change the current working directory to \var{path}. Change the current working directory to \var{path}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{chmod}{path\, mode} \begin{funcdesc}{chmod}{path, mode}
Change the mode of \var{path} to the numeric \var{mode}. Change the mode of \var{path} to the numeric \var{mode}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{chown}{path\, uid, gid} \begin{funcdesc}{chown}{path, uid, gid}
Change the owner and group id of \var{path} to the numeric \var{uid} Change the owner and group id of \var{path} to the numeric \var{uid}
and \var{gid}. and \var{gid}.
(Not on MS-DOS.) (Not on MS-DOS.)
@ -103,19 +103,19 @@ built-in function \function{open()} or by \function{popen()} or
Return a duplicate of file descriptor \var{fd}. Return a duplicate of file descriptor \var{fd}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{dup2}{fd\, fd2} \begin{funcdesc}{dup2}{fd, fd2}
Duplicate file descriptor \var{fd} to \var{fd2}, closing the latter Duplicate file descriptor \var{fd} to \var{fd2}, closing the latter
first if necessary. first if necessary.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{execv}{path\, args} \begin{funcdesc}{execv}{path, args}
Execute the executable \var{path} with argument list \var{args}, Execute the executable \var{path} with argument list \var{args},
replacing the current process (i.e., the Python interpreter). replacing the current process (i.e., the Python interpreter).
The argument list may be a tuple or list of strings. The argument list may be a tuple or list of strings.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{execve}{path\, args\, env} \begin{funcdesc}{execve}{path, args, env}
Execute the executable \var{path} with argument list \var{args}, Execute the executable \var{path} with argument list \var{args},
and environment \var{env}, and environment \var{env},
replacing the current process (i.e., the Python interpreter). replacing the current process (i.e., the Python interpreter).
@ -134,7 +134,7 @@ Note: the standard way to exit is \code{sys.exit(\var{n})}.
after a \function{fork()}. after a \function{fork()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{fdopen}{fd\optional{\, mode\optional{\, bufsize}}} \begin{funcdesc}{fdopen}{fd\optional{, mode\optional{, bufsize}}}
Return an open file object connected to the file descriptor \var{fd}. Return an open file object connected to the file descriptor \var{fd}.
The \var{mode} and \var{bufsize} arguments have the same meaning as The \var{mode} and \var{bufsize} arguments have the same meaning as
the corresponding arguments to the built-in \function{open()} function. the corresponding arguments to the built-in \function{open()} function.
@ -150,7 +150,7 @@ process id in the parent.
Return status for file descriptor \var{fd}, like \function{stat()}. Return status for file descriptor \var{fd}, like \function{stat()}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{ftruncate}{fd\, length} \begin{funcdesc}{ftruncate}{fd, length}
Truncate the file corresponding to file descriptor \var{fd}, Truncate the file corresponding to file descriptor \var{fd},
so that it is at most \var{length} bytes in size. so that it is at most \var{length} bytes in size.
\end{funcdesc} \end{funcdesc}
@ -194,12 +194,12 @@ Return the current process' user id.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{kill}{pid\, sig} \begin{funcdesc}{kill}{pid, sig}
Kill the process \var{pid} with signal \var{sig}. Kill the process \var{pid} with signal \var{sig}.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{link}{src\, dst} \begin{funcdesc}{link}{src, dst}
Create a hard link pointing to \var{src} named \var{dst}. Create a hard link pointing to \var{src} named \var{dst}.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
@ -211,7 +211,7 @@ entries \code{'.'} and \code{'..'} even if they are present in the
directory. directory.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{lseek}{fd\, pos\, how} \begin{funcdesc}{lseek}{fd, pos, how}
Set the current position of file descriptor \var{fd} to position Set the current position of file descriptor \var{fd} to position
\var{pos}, modified by \var{how}: \code{0} to set the position \var{pos}, modified by \var{how}: \code{0} to set the position
relative to the beginning of the file; \code{1} to set it relative to relative to the beginning of the file; \code{1} to set it relative to
@ -224,7 +224,7 @@ Like \function{stat()}, but do not follow symbolic links. (On systems
without symbolic links, this is identical to \function{stat()}.) without symbolic links, this is identical to \function{stat()}.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{mkfifo}{path\optional{\, mode}} \begin{funcdesc}{mkfifo}{path\optional{, mode}}
Create a FIFO (a \POSIX{} named pipe) named \var{path} with numeric mode Create a FIFO (a \POSIX{} named pipe) named \var{path} with numeric mode
\var{mode}. The default \var{mode} is \code{0666} (octal). The current \var{mode}. The default \var{mode} is \code{0666} (octal). The current
umask value is first masked out from the mode. umask value is first masked out from the mode.
@ -238,7 +238,7 @@ the client opens it for writing. Note that \function{mkfifo()}
doesn't open the FIFO --- it just creates the rendezvous point. doesn't open the FIFO --- it just creates the rendezvous point.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{mkdir}{path\optional{\, mode}} \begin{funcdesc}{mkdir}{path\optional{, mode}}
Create a directory named \var{path} with numeric mode \var{mode}. Create a directory named \var{path} with numeric mode \var{mode}.
The default \var{mode} is \code{0777} (octal). On some systems, The default \var{mode} is \code{0777} (octal). On some systems,
\var{mode} is ignored. Where it is used, the current umask value is \var{mode} is ignored. Where it is used, the current umask value is
@ -250,7 +250,7 @@ Add \var{increment} to the process' ``niceness''. Return the new
niceness. (Not on MS-DOS.) niceness. (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{open}{file\, flags\optional{\, mode}} \begin{funcdesc}{open}{file, flags\optional{, mode}}
Open the file \var{file} and set various flags according to Open the file \var{file} and set various flags according to
\var{flags} and possibly its mode according to \var{mode}. \var{flags} and possibly its mode according to \var{mode}.
The default \var{mode} is \code{0777} (octal), and the current umask The default \var{mode} is \code{0777} (octal), and the current umask
@ -279,7 +279,7 @@ Lock program segments into memory. The value of \var{op}
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{popen}{command\optional{\, mode\optional{\, bufsize}}} \begin{funcdesc}{popen}{command\optional{, mode\optional{, bufsize}}}
Open a pipe to or from \var{command}. The return value is an open Open a pipe to or from \var{command}. The return value is an open
file object connected to the pipe, which can be read or written file object connected to the pipe, which can be read or written
depending on whether \var{mode} is \code{'r'} (default) or \code{'w'}. depending on whether \var{mode} is \code{'r'} (default) or \code{'w'}.
@ -291,7 +291,7 @@ object.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{putenv}{varname\, value} \begin{funcdesc}{putenv}{varname, value}
\index{environment variables!setting} \index{environment variables!setting}
Set the environment variable named \var{varname} to the string Set the environment variable named \var{varname} to the string
\var{value}. Such changes to the environment affect subprocesses \var{value}. Such changes to the environment affect subprocesses
@ -309,7 +309,7 @@ actually preferable to assign to items of \code{os.environ}.
Return the error message corresponding to the error code in \var{code}. Return the error message corresponding to the error code in \var{code}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{read}{fd\, n} \begin{funcdesc}{read}{fd, n}
Read at most \var{n} bytes from file descriptor \var{fd}. Read at most \var{n} bytes from file descriptor \var{fd}.
Return a string containing the bytes read. Return a string containing the bytes read.
@ -333,7 +333,7 @@ directory. This is identical to the \function{unlink()} function
documented below. documented below.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{rename}{src\, dst} \begin{funcdesc}{rename}{src, dst}
Rename the file or directory \var{src} to \var{dst}. Rename the file or directory \var{src} to \var{dst}.
\end{funcdesc} \end{funcdesc}
@ -353,7 +353,7 @@ Calls the system call \cfunction{setpgrp()} or \cfunction{setpgrp(0,
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setpgid}{pid\, pgrp} \begin{funcdesc}{setpgid}{pid, pgrp}
Calls the system call \cfunction{setpgid()}. See the \UNIX{} manual Calls the system call \cfunction{setpgid()}. See the \UNIX{} manual
for the semantics. for the semantics.
(Not on MS-DOS.) (Not on MS-DOS.)
@ -393,7 +393,7 @@ functions and constants that are useful for extracting information
from a stat structure. from a stat structure.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{symlink}{src\, dst} \begin{funcdesc}{symlink}{src, dst}
Create a symbolic link pointing to \var{src} named \var{dst}. (On Create a symbolic link pointing to \var{src} named \var{dst}. (On
systems without symbolic links, this always raises \exception{error}.) systems without symbolic links, this always raises \exception{error}.)
\end{funcdesc} \end{funcdesc}
@ -413,7 +413,7 @@ Return the process group associated with the terminal given by
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{tcsetpgrp}{fd\, pg} \begin{funcdesc}{tcsetpgrp}{fd, pg}
Set the process group associated with the terminal given by Set the process group associated with the terminal given by
\var{fd} (an open file descriptor as returned by \function{open()}) \var{fd} (an open file descriptor as returned by \function{open()})
to \var{pg}. to \var{pg}.
@ -453,7 +453,7 @@ Remove the file \var{path}. This is the same function as \code{remove};
the \code{unlink} name is its traditional \UNIX{} name. the \code{unlink} name is its traditional \UNIX{} name.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{utime}{path\, {\rm (}atime, mtime{\rm )}} \begin{funcdesc}{utime}{path, {\rm (}atime, mtime{\rm )}}
Set the access and modified time of the file to the given values. Set the access and modified time of the file to the given values.
(The second argument is a tuple of two items.) (The second argument is a tuple of two items.)
\end{funcdesc} \end{funcdesc}
@ -466,7 +466,7 @@ exit status (if the signal number is zero); the high bit of the low
byte is set if a core file was produced. (Not on MS-DOS.) byte is set if a core file was produced. (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{waitpid}{pid\, options} \begin{funcdesc}{waitpid}{pid, options}
Wait for completion of a child process given by proces id, and return Wait for completion of a child process given by proces id, and return
a tuple containing its pid and exit status indication (encoded as for a tuple containing its pid and exit status indication (encoded as for
\function{wait()}). The semantics of the call are affected by the \function{wait()}). The semantics of the call are affected by the
@ -476,7 +476,7 @@ normal operation. (If the system does not support
MS-DOS.) MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{write}{fd\, str} \begin{funcdesc}{write}{fd, str}
Write the string \var{str} to file descriptor \var{fd}. Write the string \var{str} to file descriptor \var{fd}.
Return the number of bytes actually written. Return the number of bytes actually written.

View file

@ -80,7 +80,7 @@ different device than \var{p}, or whether \file{\var{p}/..} and
detect mount points for all \UNIX{} and \POSIX{} variants. detect mount points for all \UNIX{} and \POSIX{} variants.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{join}{p\optional{\, q\optional{\, ...}}} \begin{funcdesc}{join}{p\optional{, q\optional{, ...}}}
Joins one or more path components intelligently. If any component is Joins one or more path components intelligently. If any component is
an absolute path, all previous components are thrown away, and joining an absolute path, all previous components are thrown away, and joining
continues. The return value is the concatenation of \var{p}, and continues. The return value is the concatenation of \var{p}, and
@ -103,7 +103,7 @@ case (use \function{normcase()} for that). On Windows, it does
converts forward slashes to backward slashes. converts forward slashes to backward slashes.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{samefile}{p\, q} \begin{funcdesc}{samefile}{p, q}
Return true if both pathname arguments refer to the same file or Return true if both pathname arguments refer to the same file or
directory (as indicated by device number and i-node number). directory (as indicated by device number and i-node number).
Raise an exception if a \function{os.stat()} call on either pathname Raise an exception if a \function{os.stat()} call on either pathname
@ -130,7 +130,7 @@ and \var{ext} is empty or begins with a period and contains
at most one period. at most one period.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{walk}{p\, visit\, arg} \begin{funcdesc}{walk}{p, visit, arg}
Calls the function \var{visit} with arguments Calls the function \var{visit} with arguments
\code{(\var{arg}, \var{dirname}, \var{names})} for each directory in the \code{(\var{arg}, \var{dirname}, \var{names})} for each directory in the
directory tree rooted at \var{p} (including \var{p} itself, if it is a directory tree rooted at \var{p} (including \var{p} itself, if it is a

View file

@ -269,7 +269,7 @@ Profiler Extensions, which includes discussion of how to derive
``better'' profilers from the classes presented, or reading the source ``better'' profilers from the classes presented, or reading the source
code for these modules. code for these modules.
\begin{funcdesc}{profile.run}{string\optional{\, filename\optional{\, ...}}} \begin{funcdesc}{profile.run}{string\optional{, filename\optional{, ...}}}
This function takes a single argument that has can be passed to the This function takes a single argument that has can be passed to the
\keyword{exec} statement, and an optional file name. In all cases this \keyword{exec} statement, and an optional file name. In all cases this
@ -338,7 +338,7 @@ Analysis of the profiler data is done using this class from the
\setindexsubitem{(in module pstats)} \setindexsubitem{(in module pstats)}
\begin{classdesc}{Stats}{filename\optional{\, ...}} \begin{classdesc}{Stats}{filename\optional{, ...}}
This class constructor creates an instance of a ``statistics object'' This class constructor creates an instance of a ``statistics object''
from a \var{filename} (or set of filenames). \class{Stats} objects are from a \var{filename} (or set of filenames). \class{Stats} objects are
manipulated by methods, in order to print useful reports. manipulated by methods, in order to print useful reports.
@ -375,7 +375,7 @@ statistics for these two entries are accumulated into a single entry.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{add}{filename\optional{\, ...}} \begin{funcdesc}{add}{filename\optional{, ...}}
This method of the \class{Stats} class accumulates additional This method of the \class{Stats} class accumulates additional
profiling information into the current profiling object. Its profiling information into the current profiling object. Its
arguments should refer to filenames created by the corresponding arguments should refer to filenames created by the corresponding
@ -384,7 +384,7 @@ version of \function{profile.run()}. Statistics for identically named
single function statistics. single function statistics.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{sort_stats}{key\optional{\, ...}} \begin{funcdesc}{sort_stats}{key\optional{, ...}}
This method modifies the \class{Stats} object by sorting it according This method modifies the \class{Stats} object by sorting it according
to the supplied criteria. The argument is typically a string to the supplied criteria. The argument is typically a string
identifying the basis of a sort (example: \code{"time"} or identifying the basis of a sort (example: \code{"time"} or
@ -441,7 +441,7 @@ now that ascending vs descending order is properly selected based on
the sort key of choice. the sort key of choice.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{print_stats}{restriction\optional{\, ...}} \begin{funcdesc}{print_stats}{restriction\optional{, ...}}
This method for the \class{Stats} class prints out a report as described This method for the \class{Stats} class prints out a report as described
in the \function{profile.run()} definition. in the \function{profile.run()} definition.
@ -476,7 +476,7 @@ and then proceed to only print the first 10\% of them.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{print_callers}{restrictions\optional{\, ...}} \begin{funcdesc}{print_callers}{restrictions\optional{, ...}}
This method for the \class{Stats} class prints a list of all functions This method for the \class{Stats} class prints a list of all functions
that called each function in the profiled database. The ordering is that called each function in the profiled database. The ordering is
identical to that provided by \method{print_stats()}, and the definition identical to that provided by \method{print_stats()}, and the definition
@ -486,7 +486,7 @@ times this specific call was made. A second non-parenthesized number
is the cumulative time spent in the function at the right. is the cumulative time spent in the function at the right.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{print_callees}{restrictions\optional{\, ...}} \begin{funcdesc}{print_callees}{restrictions\optional{, ...}}
This method for the \class{Stats} class prints a list of all function This method for the \class{Stats} class prints a list of all function
that were called by the indicated function. Aside from this reversal that were called by the indicated function. Aside from this reversal
of direction of calls (re: called vs was called by), the arguments and of direction of calls (re: called vs was called by), the arguments and

View file

@ -13,7 +13,7 @@ are many such characters, as when sending a graphics file.
\setindexsubitem{(in module quopri)} \setindexsubitem{(in module quopri)}
\begin{funcdesc}{decode}{input\, output} \begin{funcdesc}{decode}{input, output}
Decode the contents of the \var{input} file and write the resulting Decode the contents of the \var{input} file and write the resulting
decoded binary data to the \var{output} file. decoded binary data to the \var{output} file.
\var{input} and \var{output} must either be file objects or objects that \var{input} and \var{output} must either be file objects or objects that
@ -21,7 +21,7 @@ mimic the file object interface. \var{input} will be read until
\code{\var{input}.read()} returns an empty string. \code{\var{input}.read()} returns an empty string.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{encode}{input\, output\, quotetabs} \begin{funcdesc}{encode}{input, output, quotetabs}
Encode the contents of the \var{input} file and write the resulting Encode the contents of the \var{input} file and write the resulting
quoted-printable data to the \var{output} file. quoted-printable data to the \var{output} file.
\var{input} and \var{output} must either be file objects or objects that \var{input} and \var{output} must either be file objects or objects that

View file

@ -192,21 +192,21 @@ The module defines these functions, and an exception:
\setindexsubitem{(in module regex)} \setindexsubitem{(in module regex)}
\begin{funcdesc}{match}{pattern\, string} \begin{funcdesc}{match}{pattern, string}
Return how many characters at the beginning of \var{string} match Return how many characters at the beginning of \var{string} match
the regular expression \var{pattern}. Return \code{-1} if the the regular expression \var{pattern}. Return \code{-1} if the
string does not match the pattern (this is different from a string does not match the pattern (this is different from a
zero-length match!). zero-length match!).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{search}{pattern\, string} \begin{funcdesc}{search}{pattern, string}
Return the first position in \var{string} that matches the regular Return the first position in \var{string} that matches the regular
expression \var{pattern}. Return \code{-1} if no position in the string expression \var{pattern}. Return \code{-1} if no position in the string
matches the pattern (this is different from a zero-length match matches the pattern (this is different from a zero-length match
anywhere!). anywhere!).
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{compile}{pattern\optional{\, translate}} \begin{funcdesc}{compile}{pattern\optional{, translate}}
Compile a regular expression pattern into a regular expression Compile a regular expression pattern into a regular expression
object, which can be used for matching using its \code{match()} and object, which can be used for matching using its \code{match()} and
\code{search()} methods, described below. The optional argument \code{search()} methods, described below. The optional argument
@ -252,7 +252,7 @@ expressions.)
Returns the current value of the syntax flags as an integer. Returns the current value of the syntax flags as an integer.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{symcomp}{pattern\optional{\, translate}} \begin{funcdesc}{symcomp}{pattern\optional{, translate}}
This is like \code{compile()}, but supports symbolic group names: if a This is like \code{compile()}, but supports symbolic group names: if a
parenthesis-enclosed group begins with a group name in angular parenthesis-enclosed group begins with a group name in angular
brackets, e.g. \code{'\e(<id>[a-z][a-z0-9]*\e)'}, the group can brackets, e.g. \code{'\e(<id>[a-z][a-z0-9]*\e)'}, the group can
@ -279,7 +279,7 @@ equivalents.
Compiled regular expression objects support these methods: Compiled regular expression objects support these methods:
\setindexsubitem{(regex method)} \setindexsubitem{(regex method)}
\begin{funcdesc}{match}{string\optional{\, pos}} \begin{funcdesc}{match}{string\optional{, pos}}
Return how many characters at the beginning of \var{string} match Return how many characters at the beginning of \var{string} match
the compiled regular expression. Return \code{-1} if the string the compiled regular expression. Return \code{-1} if the string
does not match the pattern (this is different from a zero-length does not match the pattern (this is different from a zero-length
@ -293,7 +293,7 @@ Compiled regular expression objects support these methods:
is to start. is to start.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{search}{string\optional{\, pos}} \begin{funcdesc}{search}{string\optional{, pos}}
Return the first position in \var{string} that matches the regular Return the first position in \var{string} that matches the regular
expression \code{pattern}. Return \code{-1} if no position in the expression \code{pattern}. Return \code{-1} if no position in the
string matches the pattern (this is different from a zero-length string matches the pattern (this is different from a zero-length
@ -303,7 +303,7 @@ Compiled regular expression objects support these methods:
\code{match()} method. \code{match()} method.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{group}{index\, index\, ...} \begin{funcdesc}{group}{index, index, ...}
This method is only valid when the last call to the \code{match()} This method is only valid when the last call to the \code{match()}
or \code{search()} method found a match. It returns one or more or \code{search()} method found a match. It returns one or more
groups of the match. If there is a single \var{index} argument, groups of the match. If there is a single \var{index} argument,

View file

@ -20,7 +20,7 @@ conversion help, see the URL
\setindexsubitem{(in module regsub)} \setindexsubitem{(in module regsub)}
\begin{funcdesc}{sub}{pat\, repl\, str} \begin{funcdesc}{sub}{pat, repl, str}
Replace the first occurrence of pattern \var{pat} in string Replace the first occurrence of pattern \var{pat} in string
\var{str} by replacement \var{repl}. If the pattern isn't found, \var{str} by replacement \var{repl}. If the pattern isn't found,
the string is returned unchanged. The pattern may be a string or an the string is returned unchanged. The pattern may be a string or an
@ -28,7 +28,7 @@ already compiled pattern. The replacement may contain references
\samp{\e \var{digit}} to subpatterns and escaped backslashes. \samp{\e \var{digit}} to subpatterns and escaped backslashes.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{gsub}{pat\, repl\, str} \begin{funcdesc}{gsub}{pat, repl, str}
Replace all (non-overlapping) occurrences of pattern \var{pat} in Replace all (non-overlapping) occurrences of pattern \var{pat} in
string \var{str} by replacement \var{repl}. The same rules as for string \var{str} by replacement \var{repl}. The same rules as for
\code{sub()} apply. Empty matches for the pattern are replaced only \code{sub()} apply. Empty matches for the pattern are replaced only
@ -36,7 +36,7 @@ when not adjacent to a previous match, so e.g.
\code{gsub('', '-', 'abc')} returns \code{'-a-b-c-'}. \code{gsub('', '-', 'abc')} returns \code{'-a-b-c-'}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{split}{str\, pat\optional{\, maxsplit}} \begin{funcdesc}{split}{str, pat\optional{, maxsplit}}
Split the string \var{str} in fields separated by delimiters matching Split the string \var{str} in fields separated by delimiters matching
the pattern \var{pat}, and return a list containing the fields. Only the pattern \var{pat}, and return a list containing the fields. Only
non-empty matches for the pattern are considered, so e.g. non-empty matches for the pattern are considered, so e.g.
@ -47,7 +47,7 @@ occur, and the remainder of the string is returned as the final
element of the list. element of the list.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{splitx}{str\, pat\optional{\, maxsplit}} \begin{funcdesc}{splitx}{str, pat\optional{, maxsplit}}
Split the string \var{str} in fields separated by delimiters matching Split the string \var{str} in fields separated by delimiters matching
the pattern \var{pat}, and return a list containing the fields as well the pattern \var{pat}, and return a list containing the fields as well
as the separators. For example, \code{splitx('a:::b', ':*')} returns as the separators. For example, \code{splitx('a:::b', ':*')} returns
@ -55,7 +55,7 @@ as the separators. For example, \code{splitx('a:::b', ':*')} returns
as \code{split}. as \code{split}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{capwords}{s\optional{\, pat}} \begin{funcdesc}{capwords}{s\optional{, pat}}
Capitalize words separated by optional pattern \var{pat}. The default Capitalize words separated by optional pattern \var{pat}. The default
pattern uses any characters except letters, digits and underscores as pattern uses any characters except letters, digits and underscores as
word delimiters. Capitalization is done by changing the first word delimiters. Capitalization is done by changing the first

View file

@ -151,7 +151,7 @@ Import the module \var{modulename}, raising an \exception{ImportError}
exception if the module is considered unsafe. exception if the module is considered unsafe.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{r_open}{filename\optional{\, mode\optional{\, bufsize}}} \begin{funcdesc}{r_open}{filename\optional{, mode\optional{, bufsize}}}
Method called when \function{open()} is called in the restricted Method called when \function{open()} is called in the restricted
environment. The arguments are identical to those of \function{open()}, environment. The arguments are identical to those of \function{open()},
and a file object (or a class instance compatible with file objects) and a file object (or a class instance compatible with file objects)
@ -172,7 +172,7 @@ restricted environment's \code{sys.modules} dictionary).
And their equivalents with access to restricted standard I/O streams: And their equivalents with access to restricted standard I/O streams:
\begin{funcdesc}{s_import}{modulename\optional{\, globals, locals, fromlist}} \begin{funcdesc}{s_import}{modulename\optional{, globals, locals, fromlist}}
Import the module \var{modulename}, raising an \exception{ImportError} Import the module \var{modulename}, raising an \exception{ImportError}
exception if the module is considered unsafe. exception if the module is considered unsafe.
\end{funcdesc} \end{funcdesc}

View file

@ -29,7 +29,7 @@ the string. This format is suitable to pass to \code{gl.lrectwrite},
for instance. for instance.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{longstoimage}{data\, x\, y\, z\, file} \begin{funcdesc}{longstoimage}{data, x, y, z, file}
This function writes the RGBA data in \var{data} to image This function writes the RGBA data in \var{data} to image
file \var{file}. \var{x} and \var{y} give the size of the image. file \var{file}. \var{x} and \var{y} give the size of the image.
\var{z} is 1 if the saved image should be 1 byte greyscale, 3 if the \var{z} is 1 if the saved image should be 1 byte greyscale, 3 if the

Some files were not shown because too many files have changed in this diff Show more