Kaydet (Commit) eb0f066f authored tarafından Guido van Rossum's avatar Guido van Rossum

Correct small nits reported by Rob Hooft.

üst 51ca6e3e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Exceptions can be class objects or string objects. While Exceptions can be class objects or string objects. While
traditionally, most exceptions have been string objects, in Python traditionally, most exceptions have been string objects, in Python
1.5a4, all standard exceptions have been converted to class objects, 1.5, all standard exceptions have been converted to class objects,
and users are encouraged to the the same. The source code for those and users are encouraged to the the same. The source code for those
exceptions is present in the standard library module exceptions is present in the standard library module
\code{exceptions}; this module never needs to be imported explicitly. \code{exceptions}; this module never needs to be imported explicitly.
...@@ -20,7 +20,7 @@ The string value of all built-in exceptions is their name, but this is ...@@ -20,7 +20,7 @@ The string value of all built-in exceptions is their name, but this is
not a requirement for user-defined exceptions or exceptions defined by not a requirement for user-defined exceptions or exceptions defined by
library modules. library modules.
For class exceptions, in a \code{try} statement with an\code{except} For class exceptions, in a \code{try} statement with an \code{except}
clause that mentions a particular class, that clause also handles clause that mentions a particular class, that clause also handles
any exception classes derived from that class (but not exception any exception classes derived from that class (but not exception
classes from which \emph{it} is derived). Two exception classes classes from which \emph{it} is derived). Two exception classes
......
...@@ -126,14 +126,14 @@ class instances are callable if they have an attribute \code{__call__}. ...@@ -126,14 +126,14 @@ class instances are callable if they have an attribute \code{__call__}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{dir}{} \begin{funcdesc}{dir}{}
XXX New functionality takes anything and looks in __dict__,
__methods__, __members__.
Without arguments, return the list of names in the current local Without arguments, return the list of names in the current local
symbol table. With a module, class or class instance object as symbol table. With an argument, attempts to return a list of valid
argument (or anything else that has a \code{__dict__} attribute), attribute for that object. This information is gleaned from the
returns the list of names in that object's attribute dictionary. object's \code{__dict__}, \code{__methods__} and \code{__members__}
The resulting list is sorted. For example: attributes, if defined. The list is not necessarily complete; e.g.,
for classes, attributes defined in base classes are not included,
and for class instances, methods are not included.
The resulting list is sorted alphabetically. For example:
\bcode\begin{verbatim} \bcode\begin{verbatim}
>>> import sys >>> import sys
...@@ -146,8 +146,8 @@ __methods__, __members__. ...@@ -146,8 +146,8 @@ __methods__, __members__.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{divmod}{a\, b} \begin{funcdesc}{divmod}{a\, b}
Take two numbers as arguments and return a pair of integers Take two numbers as arguments and return a pair of numbers consisting
consisting of their integer quotient and remainder. 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
plain and long integers, the result is the same as plain and long integers, the result is the same as
\code{(\var{a} / \var{b}, \var{a} \%{} \var{b})}. \code{(\var{a} / \var{b}, \var{a} \%{} \var{b})}.
...@@ -249,7 +249,7 @@ module from which it is called). ...@@ -249,7 +249,7 @@ module from which it is called).
\begin{funcdesc}{hash}{object} \begin{funcdesc}{hash}{object}
Return the hash value of the object (if it has one). Hash values Return the hash value of the object (if it has one). Hash values
are 32-bit integers. They are used to quickly compare dictionary are integers. They are used to quickly compare dictionary
keys during a dictionary lookup. Numeric values that compare equal keys during a dictionary lookup. Numeric values that compare equal
have the same hash value (even if they are of different types, e.g. have the same hash value (even if they are of different types, e.g.
1 and 1.0). 1 and 1.0).
...@@ -275,8 +275,8 @@ module from which it is called). ...@@ -275,8 +275,8 @@ module from which it is called).
\begin{funcdesc}{input}{\optional{prompt}} \begin{funcdesc}{input}{\optional{prompt}}
Almost equivalent to \code{eval(raw_input(\var{prompt}))}. Like Almost equivalent to \code{eval(raw_input(\var{prompt}))}. Like
\code{raw_input()}, the \var{prompt} argument is optional, and GNU \code{raw_input()}, the \var{prompt} argument is optional, and the
readline is used when configured. The difference \code{readline} module is used when loaded. The difference
is that a long input expression may be broken over multiple lines using is that a long input expression may be broken over multiple lines using
the backslash convention. the backslash convention.
\end{funcdesc} \end{funcdesc}
...@@ -348,7 +348,7 @@ desired effect. ...@@ -348,7 +348,7 @@ desired effect.
arbitrary size, possibly embedded in whitespace; arbitrary size, possibly embedded in whitespace;
this behaves identical to \code{string.atol(\var{x})}. this behaves identical to \code{string.atol(\var{x})}.
Otherwise, the argument may be a plain or Otherwise, the argument may be a plain or
long integer or a floating point number, and a long interger with long integer or a floating point number, and a long integer with
the same value is returned. Conversion of floating the same value is returned. Conversion of floating
point numbers to integers is defined by the C semantics; point numbers to integers is defined by the C semantics;
see the description of \code{int()}. see the description of \code{int()}.
...@@ -481,7 +481,7 @@ there's no reliable way to determine whether this is the case.} ...@@ -481,7 +481,7 @@ there's no reliable way to determine whether this is the case.}
>>> >>>
\end{verbatim}\ecode \end{verbatim}\ecode
If the interpreter was built to use the GNU readline library, then If the \code{readline} module was loaded, then
\code{raw_input()} will use it to provide elaborate \code{raw_input()} will use it to provide elaborate
line editing and history features. line editing and history features.
\end{funcdesc} \end{funcdesc}
......
...@@ -75,7 +75,7 @@ Using long option names is equally easy: ...@@ -75,7 +75,7 @@ Using long option names is equally easy:
\end{verbatim}\ecode \end{verbatim}\ecode
% %
The exception The exception
\code{getopt.error = 'getopt.error'} \code{getopt.error}
is raised when an unrecognized option is found in the argument list or is raised when an unrecognized option is found in the argument list or
when an option requiring an argument is given none. when an option requiring an argument is given none.
The argument to the exception is a string indicating the cause of the The argument to the exception is a string indicating the cause of the
......
...@@ -15,7 +15,7 @@ The gid is an integer, name and password are strings, and the member ...@@ -15,7 +15,7 @@ The gid is an integer, name and password are strings, and the member
list is a list of strings. list is a list of strings.
(Note that most users are not explicitly listed as members of the (Note that most users are not explicitly listed as members of the
group they are in according to the password database.) group they are in according to the password database.)
An exception is raised if the entry asked for cannot be found. A \code{KeyError} exception is raised if the entry asked for cannot be found.
It defines the following items: It defines the following items:
......
...@@ -21,7 +21,7 @@ object, though it's not possible to use the \code{seek()} and ...@@ -21,7 +21,7 @@ object, though it's not possible to use the \code{seek()} and
The \file{gzip} file format includes the original filename of the The \file{gzip} file format includes the original filename of the
uncompressed file; when opening a \code{GzipFile} object for uncompressed file; when opening a \code{GzipFile} object for
writing, it can be set by the \var{filename} argument. The default writing, it can be set by the \var{filename} argument. The default
value is \code{"GzippedFile"}. value is an empty string.
\var{mode} can be either \code{'r'} or \code{'w'} depending on \var{mode} can be either \code{'r'} or \code{'w'} depending on
whether the file will be read or written. \var{compresslevel} is an whether the file will be read or written. \var{compresslevel} is an
......
...@@ -148,17 +148,17 @@ Return a string representing the current working directory. ...@@ -148,17 +148,17 @@ Return a string representing the current working directory.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{getegid}{} \begin{funcdesc}{getegid}{}
Return the current process's effective group id. Return the current process' effective group id.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{geteuid}{} \begin{funcdesc}{geteuid}{}
Return the current process's effective user id. Return the current process' effective user id.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{getgid}{} \begin{funcdesc}{getgid}{}
Return the current process's group id. Return the current process' group id.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
...@@ -178,7 +178,7 @@ Return the parent's process id. ...@@ -178,7 +178,7 @@ Return the parent's process id.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{getuid}{} \begin{funcdesc}{getuid}{}
Return the current process's user id. Return the current process' user id.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
...@@ -326,7 +326,7 @@ Remove the directory \var{path}. ...@@ -326,7 +326,7 @@ Remove the directory \var{path}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setgid}{gid} \begin{funcdesc}{setgid}{gid}
Set the current process's group id. Set the current process' group id.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
...@@ -350,7 +350,7 @@ semantics. ...@@ -350,7 +350,7 @@ semantics.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setuid}{uid} \begin{funcdesc}{setuid}{uid}
Set the current process's user id. Set the current process' user id.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
...@@ -424,8 +424,9 @@ operating system. The tuple contains 5 strings: ...@@ -424,8 +424,9 @@ operating system. The tuple contains 5 strings:
\code{(\var{sysname}, \var{nodename}, \var{release}, \var{version}, \var{machine})}. \code{(\var{sysname}, \var{nodename}, \var{release}, \var{version}, \var{machine})}.
Some systems truncate the nodename to 8 Some systems truncate the nodename to 8
characters or to the leading component; a better way to get the characters or to the leading component; a better way to get the
hostname is \code{socket.gethostname()}. (Not on MS-DOS, nor on older hostname is \code{socket.gethostname()} or even
\UNIX{} systems.) \code{socket.gethostbyaddr(socket.gethostname())}.
(Not on MS-DOS, nor on older \UNIX{} systems.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{unlink}{path} \begin{funcdesc}{unlink}{path}
......
...@@ -15,7 +15,7 @@ following items from the password database (see \file{<pwd.h>}), in order: ...@@ -15,7 +15,7 @@ following items from the password database (see \file{<pwd.h>}), in order:
\code{pw_dir}, \code{pw_dir},
\code{pw_shell}. \code{pw_shell}.
The uid and gid items are integers, all others are strings. The uid and gid items are integers, all others are strings.
An exception is raised if the entry asked for cannot be found. A \code{KeyError} exception is raised if the entry asked for cannot be found.
It defines the following items: It defines the following items:
......
...@@ -133,7 +133,7 @@ simply match the '\code{\^}' character. ...@@ -133,7 +133,7 @@ simply match the '\code{\^}' character.
% %
\item[\code{|}]\code{A|B}, where A and B can be arbitrary REs, \item[\code{|}]\code{A|B}, where A and B can be arbitrary REs,
creates a regular expression that will match either A or B. This can creates a regular expression that will match either A or B. This can
be used inside groups (see below) as well. To match a literal '|', be used inside groups (see below) as well. To match a literal '\code{|}',
use \code{\e|}, or enclose it inside a character class, like \code{[|]}. use \code{\e|}, or enclose it inside a character class, like \code{[|]}.
% %
\item[\code{(...)}] Matches whatever regular expression is inside the \item[\code{(...)}] Matches whatever regular expression is inside the
......
...@@ -37,7 +37,7 @@ regular expression represented as a string literal, you have to ...@@ -37,7 +37,7 @@ regular expression represented as a string literal, you have to
\emph{quadruple} it or enclose it in a singleton character class. \emph{quadruple} it or enclose it in a singleton character class.
E.g.\ to extract \LaTeX\ \samp{\e section\{{\rm E.g.\ to extract \LaTeX\ \samp{\e section\{{\rm
\ldots}\}} headers from a document, you can use this pattern: \ldots}\}} headers from a document, you can use this pattern:
\code{'[\e ] section\{\e (.*\e )\}'}. \emph{Another exception:} \code{'[\e ]section\{\e (.*\e )\}'}. \emph{Another exception:}
the escape sequece \samp{\e b} is significant in string literals the escape sequece \samp{\e b} is significant in string literals
(where it means the ASCII bell character) as well as in Emacs regular (where it means the ASCII bell character) as well as in Emacs regular
expressions (where it stands for a word boundary), so in order to expressions (where it stands for a word boundary), so in order to
...@@ -125,7 +125,7 @@ The special sequences consist of '\code{\e}' and a character ...@@ -125,7 +125,7 @@ The special sequences consist of '\code{\e}' and a character
from the list below. If the ordinary character is not on the list, from the list below. If the ordinary character is not on the list,
then the resulting RE will match the second character. For example, then the resulting RE will match the second character. For example,
\code{\e\$} matches the character '\$'. Ones where the backslash \code{\e\$} matches the character '\$'. Ones where the backslash
should be doubled are indicated. should be doubled in string literals are indicated.
\begin{itemize} \begin{itemize}
\item[\code{\e|}]\code{A\e|B}, where A and B can be arbitrary REs, \item[\code{\e|}]\code{A\e|B}, where A and B can be arbitrary REs,
......
...@@ -729,7 +729,7 @@ descriptors, e.g. module \code{fcntl} or \code{os.read()} and friends. ...@@ -729,7 +729,7 @@ descriptors, e.g. module \code{fcntl} or \code{os.read()} and friends.
\begin{funcdesc}{readlines}{\optional{sizehint}} \begin{funcdesc}{readlines}{\optional{sizehint}}
Read until \EOF{} using \code{readline()} and return a list containing Read until \EOF{} using \code{readline()} and return a list containing
the lines thus read. If the optional \var{bufferhint} argument is the lines thus read. If the optional \var{sizehint} argument is
present, instead of reading up to \EOF{}, whole lines totalling present, instead of reading up to \EOF{}, whole lines totalling
approximately \var{sizehint} bytes are read. approximately \var{sizehint} bytes are read.
\end{funcdesc} \end{funcdesc}
......
% XXX The module has been extended (by Jeremy) but this documentation hasn't been updated yet
\section{Built-in Module \sectcode{zlib}} \section{Built-in Module \sectcode{zlib}}
\label{module-zlib} \label{module-zlib}
\bimodindex{zlib} \bimodindex{zlib}
...@@ -6,7 +8,7 @@ For applications that require data compression, the functions in this ...@@ -6,7 +8,7 @@ For applications that require data compression, the functions in this
module allow compression and decompression, using the zlib library, module allow compression and decompression, using the zlib library,
which is based on GNU zip. The zlib library has its own home page at which is based on GNU zip. The zlib library has its own home page at
\code{http://www.cdrom.com/pub/infozip/zlib/}. \code{http://www.cdrom.com/pub/infozip/zlib/}.
Version 1.0.4 is the most recent version as of April 30, 1997; use a Version 1.0.4 is the most recent version as of December, 1997; use a
later version if one is available. later version if one is available.
The available functions in this module are: The available functions in this module are:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Exceptions can be class objects or string objects. While Exceptions can be class objects or string objects. While
traditionally, most exceptions have been string objects, in Python traditionally, most exceptions have been string objects, in Python
1.5a4, all standard exceptions have been converted to class objects, 1.5, all standard exceptions have been converted to class objects,
and users are encouraged to the the same. The source code for those and users are encouraged to the the same. The source code for those
exceptions is present in the standard library module exceptions is present in the standard library module
\code{exceptions}; this module never needs to be imported explicitly. \code{exceptions}; this module never needs to be imported explicitly.
...@@ -20,7 +20,7 @@ The string value of all built-in exceptions is their name, but this is ...@@ -20,7 +20,7 @@ The string value of all built-in exceptions is their name, but this is
not a requirement for user-defined exceptions or exceptions defined by not a requirement for user-defined exceptions or exceptions defined by
library modules. library modules.
For class exceptions, in a \code{try} statement with an\code{except} For class exceptions, in a \code{try} statement with an \code{except}
clause that mentions a particular class, that clause also handles clause that mentions a particular class, that clause also handles
any exception classes derived from that class (but not exception any exception classes derived from that class (but not exception
classes from which \emph{it} is derived). Two exception classes classes from which \emph{it} is derived). Two exception classes
......
...@@ -126,14 +126,14 @@ class instances are callable if they have an attribute \code{__call__}. ...@@ -126,14 +126,14 @@ class instances are callable if they have an attribute \code{__call__}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{dir}{} \begin{funcdesc}{dir}{}
XXX New functionality takes anything and looks in __dict__,
__methods__, __members__.
Without arguments, return the list of names in the current local Without arguments, return the list of names in the current local
symbol table. With a module, class or class instance object as symbol table. With an argument, attempts to return a list of valid
argument (or anything else that has a \code{__dict__} attribute), attribute for that object. This information is gleaned from the
returns the list of names in that object's attribute dictionary. object's \code{__dict__}, \code{__methods__} and \code{__members__}
The resulting list is sorted. For example: attributes, if defined. The list is not necessarily complete; e.g.,
for classes, attributes defined in base classes are not included,
and for class instances, methods are not included.
The resulting list is sorted alphabetically. For example:
\bcode\begin{verbatim} \bcode\begin{verbatim}
>>> import sys >>> import sys
...@@ -146,8 +146,8 @@ __methods__, __members__. ...@@ -146,8 +146,8 @@ __methods__, __members__.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{divmod}{a\, b} \begin{funcdesc}{divmod}{a\, b}
Take two numbers as arguments and return a pair of integers Take two numbers as arguments and return a pair of numbers consisting
consisting of their integer quotient and remainder. 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
plain and long integers, the result is the same as plain and long integers, the result is the same as
\code{(\var{a} / \var{b}, \var{a} \%{} \var{b})}. \code{(\var{a} / \var{b}, \var{a} \%{} \var{b})}.
...@@ -249,7 +249,7 @@ module from which it is called). ...@@ -249,7 +249,7 @@ module from which it is called).
\begin{funcdesc}{hash}{object} \begin{funcdesc}{hash}{object}
Return the hash value of the object (if it has one). Hash values Return the hash value of the object (if it has one). Hash values
are 32-bit integers. They are used to quickly compare dictionary are integers. They are used to quickly compare dictionary
keys during a dictionary lookup. Numeric values that compare equal keys during a dictionary lookup. Numeric values that compare equal
have the same hash value (even if they are of different types, e.g. have the same hash value (even if they are of different types, e.g.
1 and 1.0). 1 and 1.0).
...@@ -275,8 +275,8 @@ module from which it is called). ...@@ -275,8 +275,8 @@ module from which it is called).
\begin{funcdesc}{input}{\optional{prompt}} \begin{funcdesc}{input}{\optional{prompt}}
Almost equivalent to \code{eval(raw_input(\var{prompt}))}. Like Almost equivalent to \code{eval(raw_input(\var{prompt}))}. Like
\code{raw_input()}, the \var{prompt} argument is optional, and GNU \code{raw_input()}, the \var{prompt} argument is optional, and the
readline is used when configured. The difference \code{readline} module is used when loaded. The difference
is that a long input expression may be broken over multiple lines using is that a long input expression may be broken over multiple lines using
the backslash convention. the backslash convention.
\end{funcdesc} \end{funcdesc}
...@@ -348,7 +348,7 @@ desired effect. ...@@ -348,7 +348,7 @@ desired effect.
arbitrary size, possibly embedded in whitespace; arbitrary size, possibly embedded in whitespace;
this behaves identical to \code{string.atol(\var{x})}. this behaves identical to \code{string.atol(\var{x})}.
Otherwise, the argument may be a plain or Otherwise, the argument may be a plain or
long integer or a floating point number, and a long interger with long integer or a floating point number, and a long integer with
the same value is returned. Conversion of floating the same value is returned. Conversion of floating
point numbers to integers is defined by the C semantics; point numbers to integers is defined by the C semantics;
see the description of \code{int()}. see the description of \code{int()}.
...@@ -481,7 +481,7 @@ there's no reliable way to determine whether this is the case.} ...@@ -481,7 +481,7 @@ there's no reliable way to determine whether this is the case.}
>>> >>>
\end{verbatim}\ecode \end{verbatim}\ecode
If the interpreter was built to use the GNU readline library, then If the \code{readline} module was loaded, then
\code{raw_input()} will use it to provide elaborate \code{raw_input()} will use it to provide elaborate
line editing and history features. line editing and history features.
\end{funcdesc} \end{funcdesc}
......
...@@ -75,7 +75,7 @@ Using long option names is equally easy: ...@@ -75,7 +75,7 @@ Using long option names is equally easy:
\end{verbatim}\ecode \end{verbatim}\ecode
% %
The exception The exception
\code{getopt.error = 'getopt.error'} \code{getopt.error}
is raised when an unrecognized option is found in the argument list or is raised when an unrecognized option is found in the argument list or
when an option requiring an argument is given none. when an option requiring an argument is given none.
The argument to the exception is a string indicating the cause of the The argument to the exception is a string indicating the cause of the
......
...@@ -15,7 +15,7 @@ The gid is an integer, name and password are strings, and the member ...@@ -15,7 +15,7 @@ The gid is an integer, name and password are strings, and the member
list is a list of strings. list is a list of strings.
(Note that most users are not explicitly listed as members of the (Note that most users are not explicitly listed as members of the
group they are in according to the password database.) group they are in according to the password database.)
An exception is raised if the entry asked for cannot be found. A \code{KeyError} exception is raised if the entry asked for cannot be found.
It defines the following items: It defines the following items:
......
...@@ -21,7 +21,7 @@ object, though it's not possible to use the \code{seek()} and ...@@ -21,7 +21,7 @@ object, though it's not possible to use the \code{seek()} and
The \file{gzip} file format includes the original filename of the The \file{gzip} file format includes the original filename of the
uncompressed file; when opening a \code{GzipFile} object for uncompressed file; when opening a \code{GzipFile} object for
writing, it can be set by the \var{filename} argument. The default writing, it can be set by the \var{filename} argument. The default
value is \code{"GzippedFile"}. value is an empty string.
\var{mode} can be either \code{'r'} or \code{'w'} depending on \var{mode} can be either \code{'r'} or \code{'w'} depending on
whether the file will be read or written. \var{compresslevel} is an whether the file will be read or written. \var{compresslevel} is an
......
...@@ -148,17 +148,17 @@ Return a string representing the current working directory. ...@@ -148,17 +148,17 @@ Return a string representing the current working directory.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{getegid}{} \begin{funcdesc}{getegid}{}
Return the current process's effective group id. Return the current process' effective group id.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{geteuid}{} \begin{funcdesc}{geteuid}{}
Return the current process's effective user id. Return the current process' effective user id.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{getgid}{} \begin{funcdesc}{getgid}{}
Return the current process's group id. Return the current process' group id.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
...@@ -178,7 +178,7 @@ Return the parent's process id. ...@@ -178,7 +178,7 @@ Return the parent's process id.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{getuid}{} \begin{funcdesc}{getuid}{}
Return the current process's user id. Return the current process' user id.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
...@@ -326,7 +326,7 @@ Remove the directory \var{path}. ...@@ -326,7 +326,7 @@ Remove the directory \var{path}.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setgid}{gid} \begin{funcdesc}{setgid}{gid}
Set the current process's group id. Set the current process' group id.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
...@@ -350,7 +350,7 @@ semantics. ...@@ -350,7 +350,7 @@ semantics.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{setuid}{uid} \begin{funcdesc}{setuid}{uid}
Set the current process's user id. Set the current process' user id.
(Not on MS-DOS.) (Not on MS-DOS.)
\end{funcdesc} \end{funcdesc}
...@@ -424,8 +424,9 @@ operating system. The tuple contains 5 strings: ...@@ -424,8 +424,9 @@ operating system. The tuple contains 5 strings:
\code{(\var{sysname}, \var{nodename}, \var{release}, \var{version}, \var{machine})}. \code{(\var{sysname}, \var{nodename}, \var{release}, \var{version}, \var{machine})}.
Some systems truncate the nodename to 8 Some systems truncate the nodename to 8
characters or to the leading component; a better way to get the characters or to the leading component; a better way to get the
hostname is \code{socket.gethostname()}. (Not on MS-DOS, nor on older hostname is \code{socket.gethostname()} or even
\UNIX{} systems.) \code{socket.gethostbyaddr(socket.gethostname())}.
(Not on MS-DOS, nor on older \UNIX{} systems.)
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{unlink}{path} \begin{funcdesc}{unlink}{path}
......
...@@ -15,7 +15,7 @@ following items from the password database (see \file{<pwd.h>}), in order: ...@@ -15,7 +15,7 @@ following items from the password database (see \file{<pwd.h>}), in order:
\code{pw_dir}, \code{pw_dir},
\code{pw_shell}. \code{pw_shell}.
The uid and gid items are integers, all others are strings. The uid and gid items are integers, all others are strings.
An exception is raised if the entry asked for cannot be found. A \code{KeyError} exception is raised if the entry asked for cannot be found.
It defines the following items: It defines the following items:
......
...@@ -133,7 +133,7 @@ simply match the '\code{\^}' character. ...@@ -133,7 +133,7 @@ simply match the '\code{\^}' character.
% %
\item[\code{|}]\code{A|B}, where A and B can be arbitrary REs, \item[\code{|}]\code{A|B}, where A and B can be arbitrary REs,
creates a regular expression that will match either A or B. This can creates a regular expression that will match either A or B. This can
be used inside groups (see below) as well. To match a literal '|', be used inside groups (see below) as well. To match a literal '\code{|}',
use \code{\e|}, or enclose it inside a character class, like \code{[|]}. use \code{\e|}, or enclose it inside a character class, like \code{[|]}.
% %
\item[\code{(...)}] Matches whatever regular expression is inside the \item[\code{(...)}] Matches whatever regular expression is inside the
......
...@@ -37,7 +37,7 @@ regular expression represented as a string literal, you have to ...@@ -37,7 +37,7 @@ regular expression represented as a string literal, you have to
\emph{quadruple} it or enclose it in a singleton character class. \emph{quadruple} it or enclose it in a singleton character class.
E.g.\ to extract \LaTeX\ \samp{\e section\{{\rm E.g.\ to extract \LaTeX\ \samp{\e section\{{\rm
\ldots}\}} headers from a document, you can use this pattern: \ldots}\}} headers from a document, you can use this pattern:
\code{'[\e ] section\{\e (.*\e )\}'}. \emph{Another exception:} \code{'[\e ]section\{\e (.*\e )\}'}. \emph{Another exception:}
the escape sequece \samp{\e b} is significant in string literals the escape sequece \samp{\e b} is significant in string literals
(where it means the ASCII bell character) as well as in Emacs regular (where it means the ASCII bell character) as well as in Emacs regular
expressions (where it stands for a word boundary), so in order to expressions (where it stands for a word boundary), so in order to
...@@ -125,7 +125,7 @@ The special sequences consist of '\code{\e}' and a character ...@@ -125,7 +125,7 @@ The special sequences consist of '\code{\e}' and a character
from the list below. If the ordinary character is not on the list, from the list below. If the ordinary character is not on the list,
then the resulting RE will match the second character. For example, then the resulting RE will match the second character. For example,
\code{\e\$} matches the character '\$'. Ones where the backslash \code{\e\$} matches the character '\$'. Ones where the backslash
should be doubled are indicated. should be doubled in string literals are indicated.
\begin{itemize} \begin{itemize}
\item[\code{\e|}]\code{A\e|B}, where A and B can be arbitrary REs, \item[\code{\e|}]\code{A\e|B}, where A and B can be arbitrary REs,
......
...@@ -729,7 +729,7 @@ descriptors, e.g. module \code{fcntl} or \code{os.read()} and friends. ...@@ -729,7 +729,7 @@ descriptors, e.g. module \code{fcntl} or \code{os.read()} and friends.
\begin{funcdesc}{readlines}{\optional{sizehint}} \begin{funcdesc}{readlines}{\optional{sizehint}}
Read until \EOF{} using \code{readline()} and return a list containing Read until \EOF{} using \code{readline()} and return a list containing
the lines thus read. If the optional \var{bufferhint} argument is the lines thus read. If the optional \var{sizehint} argument is
present, instead of reading up to \EOF{}, whole lines totalling present, instead of reading up to \EOF{}, whole lines totalling
approximately \var{sizehint} bytes are read. approximately \var{sizehint} bytes are read.
\end{funcdesc} \end{funcdesc}
......
% XXX The module has been extended (by Jeremy) but this documentation hasn't been updated yet
\section{Built-in Module \sectcode{zlib}} \section{Built-in Module \sectcode{zlib}}
\label{module-zlib} \label{module-zlib}
\bimodindex{zlib} \bimodindex{zlib}
...@@ -6,7 +8,7 @@ For applications that require data compression, the functions in this ...@@ -6,7 +8,7 @@ For applications that require data compression, the functions in this
module allow compression and decompression, using the zlib library, module allow compression and decompression, using the zlib library,
which is based on GNU zip. The zlib library has its own home page at which is based on GNU zip. The zlib library has its own home page at
\code{http://www.cdrom.com/pub/infozip/zlib/}. \code{http://www.cdrom.com/pub/infozip/zlib/}.
Version 1.0.4 is the most recent version as of April 30, 1997; use a Version 1.0.4 is the most recent version as of December, 1997; use a
later version if one is available. later version if one is available.
The available functions in this module are: The available functions in this module are:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment