From eb0f066fb84e71f418cf6a27c38b128aee33a834 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 30 Dec 1997 20:38:16 +0000 Subject: Correct small nits reported by Rob Hooft. --- Doc/lib/libexcs.tex | 4 ++-- Doc/lib/libfuncs.tex | 28 ++++++++++++++-------------- Doc/lib/libgetopt.tex | 2 +- Doc/lib/libgrp.tex | 2 +- Doc/lib/libgzip.tex | 2 +- Doc/lib/libposix.tex | 17 +++++++++-------- Doc/lib/libpwd.tex | 2 +- Doc/lib/libre.tex | 2 +- Doc/lib/libregex.tex | 4 ++-- Doc/lib/libtypes.tex | 2 +- Doc/lib/libzlib.tex | 4 +++- Doc/libexcs.tex | 4 ++-- Doc/libfuncs.tex | 28 ++++++++++++++-------------- Doc/libgetopt.tex | 2 +- Doc/libgrp.tex | 2 +- Doc/libgzip.tex | 2 +- Doc/libposix.tex | 17 +++++++++-------- Doc/libpwd.tex | 2 +- Doc/libre.tex | 2 +- Doc/libregex.tex | 4 ++-- Doc/libtypes.tex | 2 +- Doc/libzlib.tex | 4 +++- 22 files changed, 72 insertions(+), 66 deletions(-) diff --git a/Doc/lib/libexcs.tex b/Doc/lib/libexcs.tex index 1a6ba40..cd49af5 100644 --- a/Doc/lib/libexcs.tex +++ b/Doc/lib/libexcs.tex @@ -2,7 +2,7 @@ Exceptions can be class objects or string objects. While 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 exceptions is present in the standard library module \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 not a requirement for user-defined exceptions or exceptions defined by 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 any exception classes derived from that class (but not exception classes from which \emph{it} is derived). Two exception classes diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex index 70be8ad..51edb33 100644 --- a/Doc/lib/libfuncs.tex +++ b/Doc/lib/libfuncs.tex @@ -126,14 +126,14 @@ class instances are callable if they have an attribute \code{__call__}. \end{funcdesc} \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 - symbol table. With a module, class or class instance object as - argument (or anything else that has a \code{__dict__} attribute), - returns the list of names in that object's attribute dictionary. - The resulting list is sorted. For example: + symbol table. With an argument, attempts to return a list of valid + attribute for that object. This information is gleaned from the + object's \code{__dict__}, \code{__methods__} and \code{__members__} + 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} >>> import sys @@ -146,8 +146,8 @@ __methods__, __members__. \end{funcdesc} \begin{funcdesc}{divmod}{a\, b} - Take two numbers as arguments and return a pair of integers - consisting of their integer quotient and remainder. With mixed + Take two numbers as arguments and return a pair of numbers consisting + of their quotient and remainder when using long division. With mixed operand types, the rules for binary arithmetic operators apply. For plain and long integers, the result is the same as \code{(\var{a} / \var{b}, \var{a} \%{} \var{b})}. @@ -249,7 +249,7 @@ module from which it is called). \begin{funcdesc}{hash}{object} 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 have the same hash value (even if they are of different types, e.g. 1 and 1.0). @@ -275,8 +275,8 @@ module from which it is called). \begin{funcdesc}{input}{\optional{prompt}} Almost equivalent to \code{eval(raw_input(\var{prompt}))}. Like - \code{raw_input()}, the \var{prompt} argument is optional, and GNU - readline is used when configured. The difference + \code{raw_input()}, the \var{prompt} argument is optional, and the + \code{readline} module is used when loaded. The difference is that a long input expression may be broken over multiple lines using the backslash convention. \end{funcdesc} @@ -348,7 +348,7 @@ desired effect. arbitrary size, possibly embedded in whitespace; this behaves identical to \code{string.atol(\var{x})}. 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 point numbers to integers is defined by the C semantics; see the description of \code{int()}. @@ -481,7 +481,7 @@ there's no reliable way to determine whether this is the case.} >>> \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 line editing and history features. \end{funcdesc} diff --git a/Doc/lib/libgetopt.tex b/Doc/lib/libgetopt.tex index 0d2f4a0..a9210b0 100644 --- a/Doc/lib/libgetopt.tex +++ b/Doc/lib/libgetopt.tex @@ -75,7 +75,7 @@ Using long option names is equally easy: \end{verbatim}\ecode % The exception -\code{getopt.error = 'getopt.error'} +\code{getopt.error} is raised when an unrecognized option is found in the argument list or when an option requiring an argument is given none. The argument to the exception is a string indicating the cause of the diff --git a/Doc/lib/libgrp.tex b/Doc/lib/libgrp.tex index 2942a1b..ab90485 100644 --- a/Doc/lib/libgrp.tex +++ b/Doc/lib/libgrp.tex @@ -15,7 +15,7 @@ The gid is an integer, name and password are strings, and the member list is a list of strings. (Note that most users are not explicitly listed as members of the 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: diff --git a/Doc/lib/libgzip.tex b/Doc/lib/libgzip.tex index d444ebf..f832da7 100644 --- a/Doc/lib/libgzip.tex +++ b/Doc/lib/libgzip.tex @@ -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 uncompressed file; when opening a \code{GzipFile} object for 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 whether the file will be read or written. \var{compresslevel} is an diff --git a/Doc/lib/libposix.tex b/Doc/lib/libposix.tex index c50b8fb..fbd7832 100644 --- a/Doc/lib/libposix.tex +++ b/Doc/lib/libposix.tex @@ -148,17 +148,17 @@ Return a string representing the current working directory. \end{funcdesc} \begin{funcdesc}{getegid}{} -Return the current process's effective group id. +Return the current process' effective group id. (Not on MS-DOS.) \end{funcdesc} \begin{funcdesc}{geteuid}{} -Return the current process's effective user id. +Return the current process' effective user id. (Not on MS-DOS.) \end{funcdesc} \begin{funcdesc}{getgid}{} -Return the current process's group id. +Return the current process' group id. (Not on MS-DOS.) \end{funcdesc} @@ -178,7 +178,7 @@ Return the parent's process id. \end{funcdesc} \begin{funcdesc}{getuid}{} -Return the current process's user id. +Return the current process' user id. (Not on MS-DOS.) \end{funcdesc} @@ -326,7 +326,7 @@ Remove the directory \var{path}. \end{funcdesc} \begin{funcdesc}{setgid}{gid} -Set the current process's group id. +Set the current process' group id. (Not on MS-DOS.) \end{funcdesc} @@ -350,7 +350,7 @@ semantics. \end{funcdesc} \begin{funcdesc}{setuid}{uid} -Set the current process's user id. +Set the current process' user id. (Not on MS-DOS.) \end{funcdesc} @@ -424,8 +424,9 @@ operating system. The tuple contains 5 strings: \code{(\var{sysname}, \var{nodename}, \var{release}, \var{version}, \var{machine})}. Some systems truncate the nodename to 8 characters or to the leading component; a better way to get the -hostname is \code{socket.gethostname()}. (Not on MS-DOS, nor on older -\UNIX{} systems.) +hostname is \code{socket.gethostname()} or even +\code{socket.gethostbyaddr(socket.gethostname())}. +(Not on MS-DOS, nor on older \UNIX{} systems.) \end{funcdesc} \begin{funcdesc}{unlink}{path} diff --git a/Doc/lib/libpwd.tex b/Doc/lib/libpwd.tex index 073c19a..82ebd61 100644 --- a/Doc/lib/libpwd.tex +++ b/Doc/lib/libpwd.tex @@ -15,7 +15,7 @@ following items from the password database (see \file{}), in order: \code{pw_dir}, \code{pw_shell}. 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: diff --git a/Doc/lib/libre.tex b/Doc/lib/libre.tex index 6791be7..33f7cb8 100644 --- a/Doc/lib/libre.tex +++ b/Doc/lib/libre.tex @@ -133,7 +133,7 @@ simply match the '\code{\^}' character. % \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 -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{[|]}. % \item[\code{(...)}] Matches whatever regular expression is inside the diff --git a/Doc/lib/libregex.tex b/Doc/lib/libregex.tex index cea8d64..2f8fbd8 100644 --- a/Doc/lib/libregex.tex +++ b/Doc/lib/libregex.tex @@ -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. E.g.\ to extract \LaTeX\ \samp{\e section\{{\rm \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 (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 @@ -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, then the resulting RE will match the second character. For example, \code{\e\$} matches the character '\$'. Ones where the backslash -should be doubled are indicated. +should be doubled in string literals are indicated. \begin{itemize} \item[\code{\e|}]\code{A\e|B}, where A and B can be arbitrary REs, diff --git a/Doc/lib/libtypes.tex b/Doc/lib/libtypes.tex index fe727e3..08c9419 100644 --- a/Doc/lib/libtypes.tex +++ b/Doc/lib/libtypes.tex @@ -729,7 +729,7 @@ descriptors, e.g. module \code{fcntl} or \code{os.read()} and friends. \begin{funcdesc}{readlines}{\optional{sizehint}} 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 approximately \var{sizehint} bytes are read. \end{funcdesc} diff --git a/Doc/lib/libzlib.tex b/Doc/lib/libzlib.tex index 28365ae..7d2cac9 100644 --- a/Doc/lib/libzlib.tex +++ b/Doc/lib/libzlib.tex @@ -1,3 +1,5 @@ +% XXX The module has been extended (by Jeremy) but this documentation hasn't been updated yet + \section{Built-in Module \sectcode{zlib}} \label{module-zlib} \bimodindex{zlib} @@ -6,7 +8,7 @@ For applications that require data compression, the functions in this module allow compression and decompression, using the zlib library, which is based on GNU zip. The zlib library has its own home page at \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. The available functions in this module are: diff --git a/Doc/libexcs.tex b/Doc/libexcs.tex index 1a6ba40..cd49af5 100644 --- a/Doc/libexcs.tex +++ b/Doc/libexcs.tex @@ -2,7 +2,7 @@ Exceptions can be class objects or string objects. While 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 exceptions is present in the standard library module \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 not a requirement for user-defined exceptions or exceptions defined by 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 any exception classes derived from that class (but not exception classes from which \emph{it} is derived). Two exception classes diff --git a/Doc/libfuncs.tex b/Doc/libfuncs.tex index 70be8ad..51edb33 100644 --- a/Doc/libfuncs.tex +++ b/Doc/libfuncs.tex @@ -126,14 +126,14 @@ class instances are callable if they have an attribute \code{__call__}. \end{funcdesc} \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 - symbol table. With a module, class or class instance object as - argument (or anything else that has a \code{__dict__} attribute), - returns the list of names in that object's attribute dictionary. - The resulting list is sorted. For example: + symbol table. With an argument, attempts to return a list of valid + attribute for that object. This information is gleaned from the + object's \code{__dict__}, \code{__methods__} and \code{__members__} + 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} >>> import sys @@ -146,8 +146,8 @@ __methods__, __members__. \end{funcdesc} \begin{funcdesc}{divmod}{a\, b} - Take two numbers as arguments and return a pair of integers - consisting of their integer quotient and remainder. With mixed + Take two numbers as arguments and return a pair of numbers consisting + of their quotient and remainder when using long division. With mixed operand types, the rules for binary arithmetic operators apply. For plain and long integers, the result is the same as \code{(\var{a} / \var{b}, \var{a} \%{} \var{b})}. @@ -249,7 +249,7 @@ module from which it is called). \begin{funcdesc}{hash}{object} 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 have the same hash value (even if they are of different types, e.g. 1 and 1.0). @@ -275,8 +275,8 @@ module from which it is called). \begin{funcdesc}{input}{\optional{prompt}} Almost equivalent to \code{eval(raw_input(\var{prompt}))}. Like - \code{raw_input()}, the \var{prompt} argument is optional, and GNU - readline is used when configured. The difference + \code{raw_input()}, the \var{prompt} argument is optional, and the + \code{readline} module is used when loaded. The difference is that a long input expression may be broken over multiple lines using the backslash convention. \end{funcdesc} @@ -348,7 +348,7 @@ desired effect. arbitrary size, possibly embedded in whitespace; this behaves identical to \code{string.atol(\var{x})}. 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 point numbers to integers is defined by the C semantics; see the description of \code{int()}. @@ -481,7 +481,7 @@ there's no reliable way to determine whether this is the case.} >>> \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 line editing and history features. \end{funcdesc} diff --git a/Doc/libgetopt.tex b/Doc/libgetopt.tex index 0d2f4a0..a9210b0 100644 --- a/Doc/libgetopt.tex +++ b/Doc/libgetopt.tex @@ -75,7 +75,7 @@ Using long option names is equally easy: \end{verbatim}\ecode % The exception -\code{getopt.error = 'getopt.error'} +\code{getopt.error} is raised when an unrecognized option is found in the argument list or when an option requiring an argument is given none. The argument to the exception is a string indicating the cause of the diff --git a/Doc/libgrp.tex b/Doc/libgrp.tex index 2942a1b..ab90485 100644 --- a/Doc/libgrp.tex +++ b/Doc/libgrp.tex @@ -15,7 +15,7 @@ The gid is an integer, name and password are strings, and the member list is a list of strings. (Note that most users are not explicitly listed as members of the 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: diff --git a/Doc/libgzip.tex b/Doc/libgzip.tex index d444ebf..f832da7 100644 --- a/Doc/libgzip.tex +++ b/Doc/libgzip.tex @@ -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 uncompressed file; when opening a \code{GzipFile} object for 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 whether the file will be read or written. \var{compresslevel} is an diff --git a/Doc/libposix.tex b/Doc/libposix.tex index c50b8fb..fbd7832 100644 --- a/Doc/libposix.tex +++ b/Doc/libposix.tex @@ -148,17 +148,17 @@ Return a string representing the current working directory. \end{funcdesc} \begin{funcdesc}{getegid}{} -Return the current process's effective group id. +Return the current process' effective group id. (Not on MS-DOS.) \end{funcdesc} \begin{funcdesc}{geteuid}{} -Return the current process's effective user id. +Return the current process' effective user id. (Not on MS-DOS.) \end{funcdesc} \begin{funcdesc}{getgid}{} -Return the current process's group id. +Return the current process' group id. (Not on MS-DOS.) \end{funcdesc} @@ -178,7 +178,7 @@ Return the parent's process id. \end{funcdesc} \begin{funcdesc}{getuid}{} -Return the current process's user id. +Return the current process' user id. (Not on MS-DOS.) \end{funcdesc} @@ -326,7 +326,7 @@ Remove the directory \var{path}. \end{funcdesc} \begin{funcdesc}{setgid}{gid} -Set the current process's group id. +Set the current process' group id. (Not on MS-DOS.) \end{funcdesc} @@ -350,7 +350,7 @@ semantics. \end{funcdesc} \begin{funcdesc}{setuid}{uid} -Set the current process's user id. +Set the current process' user id. (Not on MS-DOS.) \end{funcdesc} @@ -424,8 +424,9 @@ operating system. The tuple contains 5 strings: \code{(\var{sysname}, \var{nodename}, \var{release}, \var{version}, \var{machine})}. Some systems truncate the nodename to 8 characters or to the leading component; a better way to get the -hostname is \code{socket.gethostname()}. (Not on MS-DOS, nor on older -\UNIX{} systems.) +hostname is \code{socket.gethostname()} or even +\code{socket.gethostbyaddr(socket.gethostname())}. +(Not on MS-DOS, nor on older \UNIX{} systems.) \end{funcdesc} \begin{funcdesc}{unlink}{path} diff --git a/Doc/libpwd.tex b/Doc/libpwd.tex index 073c19a..82ebd61 100644 --- a/Doc/libpwd.tex +++ b/Doc/libpwd.tex @@ -15,7 +15,7 @@ following items from the password database (see \file{}), in order: \code{pw_dir}, \code{pw_shell}. 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: diff --git a/Doc/libre.tex b/Doc/libre.tex index 6791be7..33f7cb8 100644 --- a/Doc/libre.tex +++ b/Doc/libre.tex @@ -133,7 +133,7 @@ simply match the '\code{\^}' character. % \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 -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{[|]}. % \item[\code{(...)}] Matches whatever regular expression is inside the diff --git a/Doc/libregex.tex b/Doc/libregex.tex index cea8d64..2f8fbd8 100644 --- a/Doc/libregex.tex +++ b/Doc/libregex.tex @@ -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. E.g.\ to extract \LaTeX\ \samp{\e section\{{\rm \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 (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 @@ -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, then the resulting RE will match the second character. For example, \code{\e\$} matches the character '\$'. Ones where the backslash -should be doubled are indicated. +should be doubled in string literals are indicated. \begin{itemize} \item[\code{\e|}]\code{A\e|B}, where A and B can be arbitrary REs, diff --git a/Doc/libtypes.tex b/Doc/libtypes.tex index fe727e3..08c9419 100644 --- a/Doc/libtypes.tex +++ b/Doc/libtypes.tex @@ -729,7 +729,7 @@ descriptors, e.g. module \code{fcntl} or \code{os.read()} and friends. \begin{funcdesc}{readlines}{\optional{sizehint}} 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 approximately \var{sizehint} bytes are read. \end{funcdesc} diff --git a/Doc/libzlib.tex b/Doc/libzlib.tex index 28365ae..7d2cac9 100644 --- a/Doc/libzlib.tex +++ b/Doc/libzlib.tex @@ -1,3 +1,5 @@ +% XXX The module has been extended (by Jeremy) but this documentation hasn't been updated yet + \section{Built-in Module \sectcode{zlib}} \label{module-zlib} \bimodindex{zlib} @@ -6,7 +8,7 @@ For applications that require data compression, the functions in this module allow compression and decompression, using the zlib library, which is based on GNU zip. The zlib library has its own home page at \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. The available functions in this module are: -- cgit v0.12