The modules described in this chapter provide interfaces to operating
system features that are available on (almost) all operating systems,
-such as files and a clock. The interfaces are generally modelled
+such as files and a clock. The interfaces are generally modeled
after the \UNIX{} or C interfaces, but they are available on most
other systems as well. Here's an overview:
\lineii{NUL}{}
\lineii{SOH}{Start of heading, console interrupt}
\lineii{STX}{Start of text}
- \lineii{ETX}{Ennd of text}
+ \lineii{ETX}{End of text}
\lineii{EOT}{End of transmission}
\lineii{ENQ}{Enquiry, goes with \constant{ACK} flow control}
\lineii{ACK}{Acknowledgement}
Each time through the \method{select()} loop, the set of sockets
is scanned, and this method is called to see if there is any
interest in writing. The default method simply returns \code{1},
- indiciating that by default, all channels will be interested.
+ indicating that by default, all channels will be interested.
\end{methoddesc}
In addition, there are the basic methods needed to construct and
\end{funcdesc}
\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 fragment
multiplied by the floating-point value \var{factor}. Overflow is
silently ignored.
\end{funcdesc}
Convert the frame rate of the input fragment.
\var{state} is a tuple containing the state of the converter. The
-converter returns a tupl \code{(\var{newfragment}, \var{newstate})},
+converter returns a tuple \code{(\var{newfragment}, \var{newstate})},
and \var{newstate} should be passed to the next call of
\function{ratecv()}.
\begin{memberdesc}{wfile}
Contains the output stream for writing a response back to the client.
-Proper adherance to the HTTP protocol must be used when writing
+Proper adherence to the HTTP protocol must be used when writing
to this stream.
\end{memberdesc}
Specifies a format string for building an error response to the
client. It uses parenthesized, keyed format specifiers, so the
format operand must be a dictionary. The \var{code} key should
-be an integer, specifing the numeric HTTP error code value.
+be an integer, specifying the numeric HTTP error code value.
\var{message} should be a string containing a (detailed) error
message of what occurred, and \var{explain} should be an
explanation of the error code number. Default \var{message}
representations. Normally, you will not use these functions directly
but use wrapper modules like \refmodule{uu}\refstmodindex{uu} or
\refmodule{binhex}\refstmodindex{binhex} instead, this module solely
-exists because bit-manipuation of large amounts of data is slow in
+exists because bit-manipulation of large amounts of data is slow in
Python.
The \module{binascii} module defines the following functions:
\end{datadesc}
\begin{datadesc}{ERROR}
-An error aoocurred while trying to read the disc or its table of
+An error occurred while trying to read the disc or its table of
contents.
\end{datadesc}
\end{methoddesc}
\begin{methoddesc}[CD player]{playtrackabs}{track, minutes, seconds, frames, play}
-Like \method{play()}, except that playing begins at the spcified
+Like \method{play()}, except that playing begins at the specified
absolute time and ends at the end of the specified track.
\end{methoddesc}
\end{excdesc}
\begin{excdesc}{DuplicateSectionError}
-Exception raised when mutliple sections with the same name are found,
+Exception raised when multiple sections with the same name are found,
or if \method{add_section()} is called with the name of a section that
is already present.
\end{excdesc}
name, the object retrieved by \samp{form[\var{key}]} is not a
\class{FieldStorage} or \class{MiniFieldStorage}
instance but a list of such instances. If you expect this possibility
-(i.e., when your HTML form comtains multiple fields with the same
+(i.e., when your HTML form contains multiple fields with the same
name), use the \function{type()} function to determine whether you
have a single instance or a list of instances. For example, here's
code that concatenates any number of username fields, separated by
entire file in memory as a string. This may not be what you want.
You can test for an uploaded file by testing either the filename
attribute or the file attribute. You can then read the data at
-leasure from the file attribute:
+leisure from the file attribute:
\begin{verbatim}
fileitem = form["userfile"]
The \module{CGIHTTPServer} module defines a request-handler class,
interface compatible with
-\class{BaseHTTPServer.BaseHTTPRequestHandler} and inherits behaviour
+\class{BaseHTTPServer.BaseHTTPRequestHandler} and inherits behavior
from \class{SimpleHTTPServer.SimpleHTTPRequestHandler} but can also
run CGI scripts.
\lineiii{4}{4}{Size of chunk in big-endian byte order, not including the
header}
\lineiii{8}{\var{n}}{Data bytes, where \var{n} is the size given in
- the preceeding field}
+ the preceding field}
\lineiii{8 + \var{n}}{0 or 1}{Pad byte needed if \var{n} is odd and
chunk alignment is used}
\end{tableiii}
Execute a code object.
When an exception occurs, \method{showtraceback()} is called to
display a traceback. All exceptions are caught except
-\exception{SystemExit}, which is allowed to propogate.
+\exception{SystemExit}, which is allowed to propagate.
A note about \exception{KeyboardInterrupt}: this exception may occur
elsewhere in this code, and may not always be caught. The caller
\section{\module{curses} ---
- Terminal independant console handling}
+ Terminal independent console handling}
\declaremodule{extension}{curses}
\sectionauthor{Moshe Zadka}{mzadka@geocities.com}
\end{funcdesc}
\begin{funcdesc}{mouseinterval}{interval}
-Sets the maximum time in millisecondsthat can elapse between press and
+Sets the maximum time in milliseconds that can elapse between press and
release events in order for them to be recognized as a click, and
returns the previous interval value. The default value is 200 msec,
or one fifth of a second.
\end{methoddesc}
\begin{methoddesc}{timeout}{delay}
-Sets blocking or non-blocking read behaviour for the window. If
+Sets blocking or non-blocking read behavior for the window. If
\var{delay} is negative, blocking read is used, which will wait
indefinitely for input). If \var{delay} is zero, then non-blocking
read is used, and -1 will be returned by \method{getch()} if no input
\end{funcdesc}
\begin{funcdesc}{opendir}{path}
-Same as \function{listdir()}. Defined for backwards compatability.
+Same as \function{listdir()}. Defined for backwards compatibility.
\end{funcdesc}
\begin{funcdesc}{annotate}{head, list}
The \module{dl} module defines an interface to the
\cfunction{dlopen()} function, which is the most common interface on
\UNIX{} platforms for handling dynamically linked libraries. It allows
-the program to call arbitary functions in such a library.
+the program to call arbitrary functions in such a library.
\strong{Note:} This module will not work unless
\begin{verbatim}
Open a shared object file, and return a handle. Mode
signifies late binding (\constant{RTLD_LAZY}) or immediate binding
(\constant{RTLD_NOW}). Default is \constant{RTLD_LAZY}. Note that some
-sytems do not support \constant{RTLD_NOW}.
+systems do not support \constant{RTLD_NOW}.
Return value is a \pytype{dlobject}.
\end{funcdesc}
The \module{dl} module defines the following exception:
\begin{excdesc}{error}
-Exception raised when an error has occured inside the dynamic loading
+Exception raised when an error has occurred inside the dynamic loading
and linking routines.
\end{excdesc}
-This module supports two interface definitions, each with mulitple
+This module supports two interface definitions, each with multiple
implementations. The \emph{formatter} interface is used by the
\class{HTMLParser} class of the \refmodule{htmllib} module, and the
\emph{writer} interface is required by the formatter interface.
\end{methoddesc}
\begin{methoddesc}[formatter]{add_flowing_data}{data}
-Provide data which should be formatted with collapsed whitespaces.
-Whitespace from preceeding and successive calls to
+Provide data which should be formatted with collapsed whitespace.
+Whitespace from preceding and successive calls to
\method{add_flowing_data()} is considered as well when the whitespace
collapse is performed. The data which is passed to this method is
expected to be word-wrapped by the output device. Note that any
string is copied to the label value, with some characters recognized
to indicate a transform on the counter value. Specifically, the
character \character{1} represents the counter value formatter as an
-arabic number, the characters \character{A} and \character{a}
+Arabic number, the characters \character{A} and \character{a}
represent alphabetic representations of the counter value in upper and
lower case, respectively, and \character{I} and \character{i}
represent the counter value in Roman numerals, in upper and lower
\begin{methoddesc}[writer]{send_paragraph}{blankline}
Produce a paragraph separation of at least \var{blankline} blank
-lines, or the equivelent. The \var{blankline} value will be an
+lines, or the equivalent. The \var{blankline} value will be an
integer. Note that the implementation will receive a call to
\method{send_line_break()} before this call if a line break is needed;
this method should not include ending the last line of the paragraph.
already closed connection (e.g.\ after a successful call to
\method{quit()}. After this call the \class{FTP} instance should not
be used any more (i.e., after a call to \method{close()} or
-\method{quit()} you cannot reopen the connection by issueing another
+\method{quit()} you cannot reopen the connection by issuing another
\method{login()} method).
\end{methoddesc}
\begin{methoddesc}{save_end}{}
Ends buffering character data and returns all data saved since the
-preceeding call to \method{save_bgn()}. If the \member{nofill} flag is
+preceding call to \method{save_bgn()}. If the \member{nofill} flag is
false, whitespace is collapsed to single spaces. A call to this
-method without a preceeding call to \method{save_bgn()} will raise a
+method without a preceding call to \method{save_bgn()} will raise a
\exception{TypeError} exception.
\end{methoddesc}
\begin{funcdesc}{grey2mono}{image, width, height, threshold}
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
+thresholding all the pixels. The resulting image is tightly packed and
is probably only useful as an argument to \function{mono2grey()}.
\end{funcdesc}
\end{excdesc}
\begin{excdesc}{IMAP4.readonly}
-This exception is raised when a writeable mailbox has its status changed by the server. This is a
+This exception is raised when a writable mailbox has its status changed by the server. This is a
sub-class of \exception{IMAP4.error}. Some other client now has write permission,
and the mailbox will need to be re-opened to re-obtain write permission.
\end{excdesc}
If the module does not live in a file, the returned \var{file} is
\code{None}, \var{filename} is the empty string, and the
\var{description} tuple contains empty strings for its suffix and
-mode; the module type is as indicate in parentheses dabove. If the
+mode; the module type is as indicate in parentheses above. If the
search is unsuccessful, \exception{ImportError} is raised. Other
exceptions indicate problems with the arguments or environment.
argument must point to the shared library. The \var{name} argument is
used to construct the name of the initialization function: an external
C function called \samp{init\var{name}()} in the shared library is
-called. The optional \var{file} argment is ignored. (Note: using
+called. The optional \var{file} argument is ignored. (Note: using
shared libraries is highly system dependent, and not all systems
support it.)
\end{funcdesc}
operating systems, such as access to specific hardware; others provide
interfaces that are
specific to a particular application domain, like the World-Wide Web.
-Some modules are avaiable in all versions and ports of Python; others
+Some modules are available in all versions and ports of Python; others
are only available when the underlying system supports or requires
them; yet others are available only when a particular configuration
option was chosen at the time when Python was compiled and installed.
\samp{C}.
The \function{setlocale()} function in the \module{locale} module
-gives the Python progammer the impression that you can manipulate the
+gives the Python programmer the impression that you can manipulate the
\constant{LC_NUMERIC} locale setting, but this not the case at the C
level: C code will always find that the \constant{LC_NUMERIC} locale
setting is \samp{C}. This is because too much would break when the
convert some data from internal to external form (in an RPC buffer for
instance) and ``unmarshalling'' for the reverse process.}
-This is not a general ``persistency'' module. For general persistency
+This is not a general ``persistence'' module. For general persistence
and transfer of Python objects through RPC calls, see the modules
\refmodule{pickle} and \refmodule{shelve}. The \module{marshal} module exists
mainly to support reading and writing the ``pseudo-compiled'' code for
You can now feed this object with arbitrary strings using the
\method{update()} method, and at any point you can ask it for the
\dfn{digest} (a strong kind of 128-bit checksum,
-a.k.a. ``fingerprint'') of the contatenation of the strings fed to it
+a.k.a. ``fingerprint'') of the concatenation of the strings fed to it
so far using the \method{digest()} method.
\index{checksum!MD5}
\modulesynopsis{Lock and queue for mutual exclusion.}
The \module{mutex} defines a class that allows mutual-exclusion
-via aquiring and releasing locks. It does not require (or imply)
+via acquiring and releasing locks. It does not require (or imply)
threading or multi-tasking, though it could be useful for
those purposes.
implying it now has the lock.
Of course, no multi-threading is implied -- hence the funny interface
-for lock, where a function is called once the lock is aquired.
+for lock, where a function is called once the lock is acquired.
\end{classdesc}
used by the \UNIX{} \program{ftp} program and other FTP clients.
\begin{classdesc}{netrc}{\optional{file}}
-A \class{netrc} instance or subclass instance enapsulates data from
+A \class{netrc} instance or subclass instance encapsulates data from
a netrc file. The initialization argument, if present, specifies the
file to parse. If no argument is given, the file \file{.netrc} in the
user's home directory will be read. Parse errors will raise
Return the match for \var{key} in map \var{mapname}, or raise an
error (\exception{nis.error}) if there is none.
Both should be strings, \var{key} is 8-bit clean.
-Return value is an arbitary array of bytes (i.e., may contain \code{NULL}
+Return value is an arbitrary array of bytes (i.e., may contain \code{NULL}
and other joys).
Note that \var{mapname} is first checked if it is an alias to another name.
\begin{funcdesc}{cat}{mapname}
Return a dictionary mapping \var{key} to \var{value} such that
\code{match(\var{key}, \var{mapname})==\var{value}}.
-Note that both keys and values of the dictionary are arbitary
+Note that both keys and values of the dictionary are arbitrary
arrays of bytes.
Note that \var{mapname} is first checked if it is an alias to another name.
\end{funcdesc}
\begin{funcdesc}{fpathconf}{fd, name}
-Return system configration information relevant to an open file.
+Return system configuration information relevant to an open file.
\var{name} specifies the configuration value to retrieve; it may be a
string which is the name of a defined system value; these names are
specified in a number of standards (\POSIX.1, Unix95, Unix98, and
\end{funcdesc}
\begin{funcdesc}{pathconf}{path, name}
-Return system configration information relevant to a named file.
+Return system configuration information relevant to a named file.
\var{name} specifies the configuration value to retrieve; it may be a
string which is the name of a defined system value; these names are
specified in a number of standards (\POSIX.1, Unix95, Unix98, and
\end{funcdesc}
-\subsection{Miscellanenous System Information \label{os-path}}
+\subsection{Miscellaneous System Information \label{os-path}}
\begin{funcdesc}{confstr}{name}
\code{panel-request@nas.nasa.gov}).
All access to it should be done through the standard module
\code{panel}\refstmodindex{panel},
-which transparantly exports most functions from
+which transparently exports most functions from
\code{pnl}
but redefines
\code{pnl.dopanel()}.
define both types of elements.
Most of the accessor functions are declared in \class{SuiteInfoBase}
-and do not need to be overriden by subclasses. More importantly, the
+and do not need to be overridden by subclasses. More importantly, the
extraction of most information from a parse tree is handled through a
method called by the \class{SuiteInfoBase} constructor. The example
code for most of the classes is clear when read alongside the formal
something else. For the definition statements, the name of the
element defined is extracted and a representation object
appropriate to the definition is created with the defining subtree
-passed as an argument to the constructor. The repesentation objects
+passed as an argument to the constructor. The representation objects
are stored in instance variables and may be retrieved by name using
the appropriate accessor methods.
read in and executed as if it had been typed at the debugger prompt.
This is particularly useful for aliases. If both files exist, the one
in the home directory is read first and aliases defined there can be
-overriden by the local file.
+overridden by the local file.
\begin{description}
\modulesynopsis{Convert Python objects to streams of bytes and back.}
% Substantial improvements by Jim Kerr <jbkerr@sr.hp.com>.
-\index{persistency}
+\index{persistence}
\indexii{persistent}{objects}
\indexii{serializing}{objects}
\indexii{marshalling}{objects}
for ``pickling'' (a.k.a.\ serializing, marshalling or flattening)
nearly arbitrary Python objects. This is the act of converting
objects to a stream of bytes (and back: ``unpickling''). This is a
-more primitive notion than persistency --- although \module{pickle}
+more primitive notion than persistence --- although \module{pickle}
reads and writes file objects, it does not handle the issue of naming
persistent objects, nor the (even more complicated) area of concurrent
access to persistent objects. The \module{pickle} module can
to be used for reading and writing code objects), and at least this
avoids the possibility of smuggling Trojan horses into a program.
-For the benefit of persistency modules written using \module{pickle}, it
+For the benefit of persistence modules written using \module{pickle}, it
supports the notion of a reference to an object outside the pickled
data stream. Such objects are referenced by a name, which is an
arbitrary string of printable \ASCII{} characters. The resolution of
module defines the following functions, and an exception:
\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{object} to the open file object
\var{file}. This is equivalent to
\samp{Pickler(\var{file}, \var{bin}).dump(\var{object})}.
If the optional \var{bin} argument is present and nonzero, the binary
The format of the pickle data is identical to that produced using the
\refmodule{pickle} module, so it is possible to use \refmodule{pickle} and
-\module{cPickle} interchangably with existing pickles.
+\module{cPickle} interchangeably with existing pickles.
(Since the pickle data format is actually a tiny stack-oriented
programming language, and there are some freedoms in the encodings of
a given file on the command line) or \code{'.'} (which means the commands
reads no input, and hence must be first.)
-Similarily, the second letter can be either of \code{'-'} (which means
+Similarly, the second letter can be either of \code{'-'} (which means
the command writes to standard output), \code{'f'} (which means the
command writes a file on the command line) or \code{'.'} (which means
the command does not write anything, and hence must be last.)
This module defines a class, \class{POP3}, which encapsulates a
connection to an POP3 server and implements protocol as defined in
-\rfc{1725}. The \class{POP3} class supports both the minmal and
+\rfc{1725}. The \class{POP3} class supports both the minimal and
optional command sets.
A single class is provided by the \module{poplib} module:
\begin{methoddesc}{user}{username}
-Send user commad, response should indicate that a password is required.
+Send user command, response should indicate that a password is required.
\end{methoddesc}
\begin{methoddesc}{pass_}{password}
The original Enigma cipher was broken in 1944. % XXX: Is this right?
The version implemented here is probably a good deal more difficult to crack
(especially if you use many rotors), but it won't be impossible for
-a truly skilful and determined attacker to break the cipher. So if you want
+a truly skillful and determined attacker to break the cipher. So if you want
to keep the NSA out of your files, this rotor cipher may well be unsafe, but
for discouraging casual snooping through your files, it will probably be
just fine, and may be somewhat safer than using the \UNIX{} \program{crypt}
If a sequence of events takes longer to run than the time available
before the next event, the scheduler will simply fall behind. No
-events will be dropped; the calling code is responsible for cancelling
+events will be dropped; the calling code is responsible for canceling
events which are no longer pertinent.
\end{methoddesc}
\item
SGML comments of the form \samp{<!--\var{text}-->}. Note that
spaces, tabs, and newlines are allowed between the trailing
-\samp{>} and the immediately preceeding \samp{--}.
+\samp{>} and the immediately preceding \samp{--}.
\end{itemize}
\end{classdesc}
the same way as the \refmodule{md5} module:\ use the \function{new()}
to create an sha object, then feed this object with arbitrary strings
using the \method{update()} method, and at any point you can ask it
-for the \dfn{digest} of the contatenation of the strings fed to it
+for the \dfn{digest} of the concatenation of the strings fed to it
so far.\index{checksum!SHA} SHA digests are 160 bits instead of 128
bits.
\section{\module{shelve} ---
- Python object persistency}
+ Python object persistence}
\declaremodule{standard}{shelve}
-\modulesynopsis{Python object persistency.}
+\modulesynopsis{Python object persistence.}
A ``shelf'' is a persistent, dictionary-like object. The difference
input will be taken from \code{sys.stdin}. The second optional
argument is a filename string, which sets the initial value of the
\member{infile} member. If the stream argument is omitted or
-equal to \code{sys.stdin}, this second argument defauilts to ``stdin''.
+equal to \code{sys.stdin}, this second argument defaults to ``stdin''.
\end{classdesc}
will be the only one to receive signals (this is enforced by the
Python \module{signal} module, even if the underlying thread
implementation supports sending signals to individual threads). This
-means that signals can't be used as a means of interthread
+means that signals can't be used as a means of inter-thread
communication. Use locks instead.
\end{itemize}
\begin{excdesc}{SMTPRecipientsRefused}
All recipient addresses refused. The errors for each recipient are
- accessable through the attribute \member{recipients}, which is a
+ accessible through the attribute \member{recipients}, which is a
dictionary of exactly the same sort as \method{SMTP.sendmail()}
returns.
\end{excdesc}
The modules described in this chapter provide interfaces to operating
system features that are available on selected operating systems only.
-The interfaces are generally modelled after the \UNIX{} or \C{}
+The interfaces are generally modeled after the \UNIX{} or \C{}
interfaces but they are available on some other systems as well
(e.g. Windows or NT). Here's an overview:
\end{datadesc}
\begin{datadesc}{F_FLAG}
-Flags. System dependant: see \cfunction{statvfs()} man page.
+Flags. System dependent: see \cfunction{statvfs()} man page.
\end{datadesc}
\begin{datadesc}{F_NAMEMAX}
\begin{funcdesc}{textbreak}{str, width}
Return the number of characters of the string that fit into a space of
\var{width}
-bits wide when drawn in the curent font.
+bits wide when drawn in the current font.
\end{funcdesc}
\begin{funcdesc}{textwidth}{str}
\end{methoddesc}
The following two methods define a term ``position'' which is compatible
-between them, and is otherwise implementation dependant.
+between them, and is otherwise implementation dependent.
\begin{methoddesc}[AU_read]{setpos}{pos}
Set the file pointer to the specified position.
This module provides constants which represent the numeric values of
internal nodes of the parse tree. Unlike most Python constants, these
use lower-case names. Refer to the file \file{Grammar/Grammar} in the
-Python distribution for the defintions of the names in the context of
+Python distribution for the definitions of the names in the context of
the language grammar. The specific numeric values which the names map
to may change between Python versions.
The first argument is a list of regular expressions, either
compiled (\class{re.RegexObject} instances) or uncompiled (strings).
The optional second argument is a timeout, in seconds; the default
-is to block indefinately.
+is to block indefinitely.
Return a tuple of three items: the index in the list of the
first regular expression that matches; the match object
If a regular expression ends with a greedy match (e.g. \regexp{.*})
or if more than one expression can match the same input, the
-results are undeterministic, and may depend on the I/O timing.
+results are indeterministic, and may depend on the I/O timing.
\end{methoddesc}
bufsize\optional{, suffix}}}}
Return a file (or file-like) object that can be used as a temporary
storage area. The file is created in the most secure manner available
-in the appporpriate temporary directory for the host platform. Under
+in the appropriate temporary directory for the host platform. Under
\UNIX, the directory entry to the file is removed so that it is secure
against attacks which involve creating symbolic links to the file or
replacing the file with a symbolic link to some other file. For other
\lineiii{3}{hour}{range [0,23]}
\lineiii{4}{minute}{range [0,59]}
\lineiii{5}{second}{range [0,61]; see \strong{(1)} in \function{strftime()} description}
- \lineiii{6}{weekday}{range [0,6], monday is 0}
+ \lineiii{6}{weekday}{range [0,6], Monday is 0}
\lineiii{7}{Julian day}{range [1,366]}
\lineiii{8}{daylight savings flag}{0, 1 or -1; see below}
\end{tableiii}
\begin{funcdesc}{clock}{}
Return the current CPU time as a floating point number expressed in
-seconds. The precision, and in fact the very definiton of the meaning
+seconds. The precision, and in fact the very definition of the meaning
of ``CPU time''\index{CPU time}, depends on that of the C function
of the same name, but in any case, this is the function to use for
benchmarking\index{benchmarking} Python or timing algorithms.
This module provides constants which represent the numeric values of
leaf nodes of the parse tree (terminal tokens). Refer to the file
-\file{Grammar/Grammar} in the Python distribution for the defintions
+\file{Grammar/Grammar} in the Python distribution for the definitions
of the names in the context of the language grammar. The specific
numeric values which the names map to may change between Python
versions.
have the same meaning as the corresponding arguments to
\function{print_exception()}. The return value is a list of strings,
each ending in a newline and some containing internal newlines. When
-these lines are contatenated and printed, exactly the same text is
+these lines are concatenated and printed, exactly the same text is
printed as does \function{print_exception()}.
\end{funcdesc}
\item[\module{lockfile}]
--- wrapper around FCNTL file locking (use
-\function{fcntl.lockf()}/\function{flock()} intead; see \refmodule{fcntl})
+\function{fcntl.lockf()}/\function{flock()} instead; see \refmodule{fcntl})
\item[\module{newdir}]
--- New \function{dir()} function (the standard \function{dir()} is
\sectionauthor{Skip Montanaro}{skip@mojam.com}
\class{URLopener} and \class{FancyURLopener} objects have the
-following methodsL
+following methods.
\begin{methoddesc}{open}{fullurl\optional{, data}}
Open \var{fullurl} using the appropriate protocol. This method sets
This module defines a standard interface to break URL strings up in
-components (addessing scheme, network location, path etc.), to combine
+components (addressing scheme, network location, path etc.), to combine
the components back into a URL string, and to convert a ``relative
URL'' to an absolute URL given a ``base URL.''
\end{verbatim}
The \module{user} module looks for a file \file{.pythonrc.py} in the user's
-home directory and if it can be opened, exececutes it (using
+home directory and if it can be opened, executes it (using
\function{execfile()}\bifuncindex{execfile}) in its own (i.e. the
module \module{user}'s) global namespace. Errors during this phase
are not caught; that's up to the program that imports the
dictionary objects. It is a useful base class for
your own dictionary-like classes, which can inherit from
them and override existing methods or add new ones. In this way one
-can add new behaviours to dictionaries.
+can add new behaviors to dictionaries.
The \module{UserDict} module defines the \class{UserDict} class:
-\begin{classdesc}{UserDict}{\optional{intialdata}}
+\begin{classdesc}{UserDict}{\optional{initialdata}}
Return a class instance that simulates a dictionary. The instance's
contents are kept in a regular dictionary, which is accessible via the
\member{data} attribute of \class{UserDict} instances. If
list objects. It is a useful base class for
your own list-like classes, which can inherit from
them and override existing methods or add new ones. In this way one
-can add new behaviours to lists.
+can add new behaviors to lists.
The \module{UserList} module defines the \class{UserList} class:
string objects. It is a useful base class for
your own string-like classes, which can inherit from
them and override existing methods or add new ones. In this way one
-can add new behaviours to strings.
+can add new behaviors to strings.
The \module{UserString} module defines the \class{UserString} class:
example for inheritance and necessity to remove (override) the
\function{__hash__} method in order to trap attempts to use a
mutable object as dictionary key, which would be otherwise very
-errorprone and hard to track down.
+error prone and hard to track down.
\end{classdesc}
\end{methoddesc}
The following two methods define a term ``position'' which is compatible
-between them, and is otherwise implementation dependant.
+between them, and is otherwise implementation dependent.
\begin{methoddesc}[Wave_read]{setpos}{pos}
Set the file pointer to the specified position.
image of a WAV file.
\strong{Note:} This module does not support playing from a memory
- image asynchonously, so a combination of this flag and
+ image asynchronously, so a combination of this flag and
\constant{SND_ASYNC} will raise a \exception{RuntimeError}.
\end{datadesc}
This method is called when a syntax error is encountered. The
\var{message} is a description of what was wrong. The default method
raises a \exception{RuntimeError} exception. If this method is
-overridden, it is permissable for it to return. This method is only
+overridden, it is permissible for it to return. This method is only
called when the error can be recovered from. Unrecoverable errors
raise a \exception{RuntimeError} without first calling
\method{syntax_error()}.