Commits

Anonymous committed 6f2ab4a

Correct small nits reported by Rob Hooft.

Comments (0)

Files changed (22)

Doc/lib/libexcs.tex

 
 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.
 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

Doc/lib/libfuncs.tex

 \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
 \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})}.
 
 \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).
 
 \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}
   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()}.
 >>> 
 \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}

Doc/lib/libgetopt.tex

 \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

Doc/lib/libgrp.tex

 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:
 

Doc/lib/libgzip.tex

   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

Doc/lib/libposix.tex

 \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}
 
 \end{funcdesc}
 
 \begin{funcdesc}{getuid}{}
-Return the current process's user id.
+Return the current process' user id.
 (Not on MS-DOS.)
 \end{funcdesc}
 
 \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}
 
 \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}
 
 \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}

Doc/lib/libpwd.tex

 \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:
 

Doc/lib/libre.tex

 %
 \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

Doc/lib/libregex.tex

 \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
 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,

Doc/lib/libtypes.tex

 
 \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}

Doc/lib/libzlib.tex

+% 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}
 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:
 
 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.
 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
 \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
 \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})}.
 
 \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).
 
 \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}
   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()}.
 >>> 
 \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}

Doc/libgetopt.tex

 \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
 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:
 
   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
 \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}
 
 \end{funcdesc}
 
 \begin{funcdesc}{getuid}{}
-Return the current process's user id.
+Return the current process' user id.
 (Not on MS-DOS.)
 \end{funcdesc}
 
 \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}
 
 \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}
 
 \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}
 \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:
 
 %
 \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
 \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
 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,
 
 \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}
+% 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}
 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:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.