typos, layout and other small things
diff --git a/Doc/lib/libdbm.tex b/Doc/lib/libdbm.tex
index 6e72567..7e004d2 100644
--- a/Doc/lib/libdbm.tex
+++ b/Doc/lib/libdbm.tex
@@ -18,7 +18,8 @@
\begin{funcdesc}{open}{filename\, rwmode\, filemode}
Open a dbm database and return a mapping object. \var{filename} is
the name of the database file (without the \file{.dir} or \file{.pag}
-extensions), \var{rwmode} is \code{'r'}, \code{'w'} or \code{'rw'} as for
-\code{open}, and \var{filemode} is the \UNIX{} mode of the file, used only
-when the database has to be created.
+extensions), \var{rwmode} is \code{'r'}, \code{'w'} or \code{'rw'} to
+open the database fore reading, writing or both respectively,
+and \var{filemode} is the \UNIX{} mode of the file, used only
+when the database has to be created (but to be supplied at all times).
\end{funcdesc}
diff --git a/Doc/lib/libftplib.tex b/Doc/lib/libftplib.tex
index f78805c..63cde96 100644
--- a/Doc/lib/libftplib.tex
+++ b/Doc/lib/libftplib.tex
@@ -16,7 +16,7 @@
\begin{verbatim}
>>> from ftplib import FTP
>>> ftp = FTP('ftp.cwi.nl') # connect to host, default port
->>> ftp.login() # default user anonymous, passwd user@hostname
+>>> ftp.login() # user anonymous, passwd user@hostname
>>> ftp.retrlines('LIST') # list directory contents
total 24418
drwxrwsr-x 5 ftp-usr pdmaint 1536 Mar 20 09:48 .
diff --git a/Doc/lib/libgdbm.tex b/Doc/lib/libgdbm.tex
index 177627f..f353b5e 100644
--- a/Doc/lib/libgdbm.tex
+++ b/Doc/lib/libgdbm.tex
@@ -18,13 +18,14 @@
\end{excdesc}
\begin{funcdesc}{open}{filename\, rwmode\, filemode}
-Open a gdbm database and return a mapping object. \var{filename} is
+Open a gdbm database and return a mapping object. \var{filename} is
the name of the database file, \var{rwmode} is \code{'r'}, \code{'w'},
\code{'c'}, or \code{'n'} for reader, writer (this also gives read
access), create (writer, but create the database if it doesn't already
-exist) and newdb (which will always create a new database). Only one
-writer may open a gdbm file and many readers may open the file. Readers
-and writers cannot open the gdbm file at the same time. Note that the
-\code{GDBM_FAST} mode of opening the database is not supported. \var{filemode}
-is the \UNIX\ mode of the file, used only when a database is created.
+exist) and newdb (which will always create a new database). Only one
+writer may open a gdbm file and many readers may open the file. Readers
+and writers cannot open the gdbm file at the same time. Note that the
+\code{GDBM_FAST} mode of opening the database is not supported.
+\var{filemode} is the \UNIX\ mode of the file, used only when a
+database is created (but to be supplied at all times).
\end{funcdesc}
diff --git a/Doc/lib/libimp.tex b/Doc/lib/libimp.tex
index f995979..2e72602 100644
--- a/Doc/lib/libimp.tex
+++ b/Doc/lib/libimp.tex
@@ -142,7 +142,7 @@
return sys.modules[name]
# If any of the following calls raises an exception,
- # there's a problem we con't handle -- let the caller handle it.
+ # there's a problem we can't handle -- let the caller handle it.
# See if it's a built-in module.
m = imp.init_builtin(name)
diff --git a/Doc/lib/libjpeg.tex b/Doc/lib/libjpeg.tex
index b5c14a4..8215cad 100644
--- a/Doc/lib/libjpeg.tex
+++ b/Doc/lib/libjpeg.tex
@@ -14,7 +14,7 @@
Treat data as a pixmap of width \var{w} and height \var{h}, with \var{b} bytes per
pixel. The data is in SGI GL order, so the first pixel is in the
lower-left corner. This means that \code{lrectread} return data can
-immedeately be passed to compress. Currently only 1 byte and 4 byte
+immediately be passed to compress. Currently only 1 byte and 4 byte
pixels are allowed, the former being treated as greyscale and the
latter as RGB color. Compress returns a string that contains the
compressed picture, in JFIF format.
diff --git a/Doc/lib/libnntplib.tex b/Doc/lib/libnntplib.tex
index d2db0d5..e17ea8b 100644
--- a/Doc/lib/libnntplib.tex
+++ b/Doc/lib/libnntplib.tex
@@ -12,6 +12,7 @@
statistics about a newsgroup and print the subjects of the last 10
articles:
+\small{
\begin{verbatim}
>>> s = NNTP('news.cwi.nl')
>>> resp, count, first, last, name = s.group('comp.lang.python')
@@ -34,6 +35,7 @@
'205 news.cwi.nl closing connection. Goodbye.'
>>>
\end{verbatim}
+}
To post an article from a file (this assumes that the article has
valid headers):
diff --git a/Doc/lib/libpickle.tex b/Doc/lib/libpickle.tex
index 92020a2..579992f 100644
--- a/Doc/lib/libpickle.tex
+++ b/Doc/lib/libpickle.tex
@@ -146,7 +146,7 @@
\begin{verbatim}
u = pickle.Unpickler(f)
-x = u.load(x)
+x = u.load()
\end{verbatim}
A shorthand is:
diff --git a/Doc/lib/libposix.tex b/Doc/lib/libposix.tex
index fa0b42d..71798a4 100644
--- a/Doc/lib/libposix.tex
+++ b/Doc/lib/libposix.tex
@@ -16,7 +16,8 @@
\stmodindex{os}
The descriptions below are very terse; refer to the
-corresponding \UNIX{} manual entry for more information.
+corresponding \UNIX{} manual entry for more information. Arguments
+called \var{path} refer to a pathname given as a string.
Errors are reported as exceptions; the usual exceptions are given
for type errors, while errors reported by the system calls raise
@@ -340,7 +341,7 @@
a tuple containing its pid and exit status indication (encoded as by
\UNIX{}). The semantics of the call are affected by the value of
the integer options, which should be 0 for normal operation. (If the
-system does not support waitpid(), this always raises
+system does not support \code{waitpid()}, this always raises
\code{posix.error}. Not on MS-DOS.)
\end{funcdesc}
diff --git a/Doc/lib/libposixfile.tex b/Doc/lib/libposixfile.tex
index b257bbd..6679f12 100644
--- a/Doc/lib/libposixfile.tex
+++ b/Doc/lib/libposixfile.tex
@@ -63,11 +63,12 @@
manual page on your system.
\end{funcdesc}
-\begin{funcdesc}{flags}{fmt}
+\begin{funcdesc}{flags}{\optional{flags}}
Set the specified flags for the file that the file object is referring
to. The new flags are ORed with the old flags, unless specified
otherwise. The format is explained below in a table. Without
- arguments a string indicating the current flags is returned (this is
+ the \var{flags} argument
+ a string indicating the current flags is returned (this is
the same as the '?' modifier). For more information about the flags
refer to the fcntl manual page on your system.
\end{funcdesc}
diff --git a/Doc/lib/libprofile.tex b/Doc/lib/libprofile.tex
index 3cd4296..ea2e613 100644
--- a/Doc/lib/libprofile.tex
+++ b/Doc/lib/libprofile.tex
@@ -267,17 +267,19 @@
standard name string (file/line/function-name) that is presented in
each line. The following is a typical output from such a call:
+\small{
\begin{verbatim}
- main()
- 2706 function calls (2004 primitive calls) in 4.504 CPU seconds
+ main()
+ 2706 function calls (2004 primitive calls) in 4.504 CPU seconds
- Ordered by: standard name
+Ordered by: standard name
- ncalls tottime percall cumtime percall filename:lineno(function)
- 2 0.006 0.003 0.953 0.477 pobject.py:75(save_objects)
- 43/3 0.533 0.012 0.749 0.250 pobject.py:99(evaluate)
- ...
+ncalls tottime percall cumtime percall filename:lineno(function)
+ 2 0.006 0.003 0.953 0.477 pobject.py:75(save_objects)
+ 43/3 0.533 0.012 0.749 0.250 pobject.py:99(evaluate)
+ ...
\end{verbatim}
+}
The first line indicates that this profile was generated by the call:\\
\code{profile.run('main()')}, and hence the exec'ed string is
@@ -318,6 +320,7 @@
the actual number of calls. Note that when the function does not
recurse, these two values are the same, and only the single figure is
printed.
+
\end{funcdesc}
\begin{funcdesc}{pstats.Stats}{filename\optional{\, ...}}
@@ -480,7 +483,8 @@
be strung together. For example:
\begin{verbatim}
-pstats.Stats('foofile').strip_dirs().sort_stats('cum').print_stats().ignore()
+pstats.Stats('foofile').strip_dirs().sort_stats('cum') \
+ .print_stats().ignore()
\end{verbatim}
would perform all the indicated functions, but it would not return
diff --git a/Doc/lib/libstring.tex b/Doc/lib/libstring.tex
index 960e94b..17717df 100644
--- a/Doc/lib/libstring.tex
+++ b/Doc/lib/libstring.tex
@@ -70,7 +70,7 @@
\samp{0} means 8, anything else means 10. If \var{base} is 16, a
leading \samp{0x} or \samp{0X} is always accepted. (Note: for a more
flexible interpretation of numeric literals, use the built-in function
-\code{eval()}.
+\code{eval()}.)
\bifuncindex{eval}
\end{funcdesc}
diff --git a/Doc/lib/libsun.tex b/Doc/lib/libsun.tex
index 5628369..909c14d 100644
--- a/Doc/lib/libsun.tex
+++ b/Doc/lib/libsun.tex
@@ -97,7 +97,7 @@
\begin{funcdesc}{write}{samples}
Write is passed a python string containing audio samples to be played.
-If there is enough buffer space free it will immedeately return,
+If there is enough buffer space free it will immediately return,
otherwise it will block.
\end{funcdesc}
diff --git a/Doc/lib/libthread.tex b/Doc/lib/libthread.tex
index bd81d7c..f745384 100644
--- a/Doc/lib/libthread.tex
+++ b/Doc/lib/libthread.tex
@@ -58,7 +58,7 @@
Lock objects have the following methods:
\renewcommand{\indexsubitem}{(lock method)}
-\begin{funcdesc}{acquire}{waitflag}
+\begin{funcdesc}{acquire}{\optional{waitflag}}
Without the optional argument, this method acquires the lock
unconditionally, if necessary waiting until it is released by another
thread (only one thread at a time can acquire a lock --- that's their
diff --git a/Doc/lib/libtypes.tex b/Doc/lib/libtypes.tex
index 422a2d6..248ad6e 100644
--- a/Doc/lib/libtypes.tex
+++ b/Doc/lib/libtypes.tex
@@ -305,7 +305,7 @@
priority as the corresponding numeric operations.\footnote{They must
have since the parser can't tell the type of the operands.}
-This table lists the sequece operations sorted in ascending priority
+This table lists the sequence operations sorted in ascending priority
(operations in the same box have the same priority). In the table,
\var{s} and \var{t} are sequences of the same type; \var{n}, \var{i}
and \var{j} are integers:
diff --git a/Doc/lib/liburlparse.tex b/Doc/lib/liburlparse.tex
index c35d032..36ca949 100644
--- a/Doc/lib/liburlparse.tex
+++ b/Doc/lib/liburlparse.tex
@@ -33,9 +33,16 @@
retained if present.
Example:
-\code{urlparse('http://www.cwi.nl:80/\%7eguido/Python.html')}
+
+\begin{verbatim}
+urlparse('http://www.cwi.nl:80/%7Eguido/Python.html')
+\end{verbatim}
+
yields the tuple
-\code{('http', 'www.cwi.nl:80', '/\%7eguido/Python.html', '', '', '')}.
+
+\begin{verbatim}
+('http', 'www.cwi.nl:80', '/%7Eguido/Python.html', '', '', '')
+\end{verbatim}
If the \var{default_scheme} argument is specified, it gives the
default addressing scheme, to be used only if the URL string does not
@@ -61,9 +68,16 @@
components in the relative URL.
Example:
-\code{urljoin('http://www.cwi.nl/\%7eguido/Python.html',}
-\code{'FAQ.html')} yields the string
-\code{'http://www.cwi.nl/\%7eguido/FAQ.html'}.
+
+\begin{verbatim}
+urljoin('http://www.cwi.nl/%7Eguido/Python.html', 'FAQ.html')
+\end{verbatim}
+
+yields the string
+
+\begin{verbatim}
+'http://www.cwi.nl/%7Eguido/FAQ.html'
+\end{verbatim}
The \var{allow_fragments} argument has the same meaning as for
\code{urlparse}.