Commit a982eb1e authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

Sort changed modules into alphabetical order; no other changes

parent 3c305d96
......@@ -688,69 +688,45 @@ SourceForge CVS browser.}
\section{New and Improved Modules}
As usual, Python's standard modules had a number of enhancements and
bug fixes. Here's a partial list; consult the \file{Misc/NEWS} file
in the source tree, or the CVS logs, for a more complete list.
bug fixes. Here's a partial list of the most notable changes, sorted
alphabetically by module name. Consult the
\file{Misc/NEWS} file in the source tree for a more
complete list of changes, or look through the CVS logs for all the
details.
\begin{itemize}
\item The new \module{textwrap} module contains functions for wrapping
strings containing paragraphs of text. The \function{wrap(\var{text},
\var{width})} function takes a string and returns a list containing
the text split into lines of no more than the chosen width. The
\function{fill(\var{text}, \var{width})} function returns a single
string, reformatted to fit into lines no longer than the chosen width.
(As you can guess, \function{fill()} is built on top of
\function{wrap()}. For example:
\item The \module{array} module now supports arrays of Unicode
characters using the \samp{u} format character. Arrays also now
support using the \code{+=} assignment operator to add another array's
contents, and the \code{*=} assignment operator to repeat an array.
(Contributed by Jason Orendorff.)
\item The Distutils \class{Extension} class now supports
an extra constructor argument named \samp{depends} for listing
additional source files that an extension depends on. This lets
Distutils recompile the module if any of the dependency files are
modified. For example, if \samp{sampmodule.c} includes the header
file \file{sample.h}, you would create the \class{Extension} object like
this:
\begin{verbatim}
>>> import textwrap
>>> paragraph = "Not a whit, we defy augury: ... more text ..."
>>> textwrap.wrap(paragraph, 60)
["Not a whit, we defy augury: there's a special providence in",
"the fall of a sparrow. If it be now, 'tis not to come; if it",
...]
>>> print textwrap.fill(paragraph, 35)
Not a whit, we defy augury: there's
a special providence in the fall of
a sparrow. If it be now, 'tis not
to come; if it be not to come, it
will be now; if it be not now, yet
it will come: the readiness is all.
>>>
ext = Extension("samp",
sources=["sampmodule.c"],
depends=["sample.h"])
\end{verbatim}
The module also contains a \class{TextWrapper} class that actually
implements the text wrapping strategy. Both the
\class{TextWrapper} class and the \function{wrap()} and
\function{fill()} functions support a number of additional keyword
arguments for fine-tuning the formatting; consult the module's
documentation for details.
% XXX add a link to the module docs?
(Contributed by Greg Ward.)
\item Two new functions in the \module{math} module,
\function{degrees(\var{rads})} and \function{radians(\var{degs})},
convert between radians and degrees. Other functions in the
\module{math} module such as
\function{math.sin()} and \function{math.cos()} have always required
input values measured in radians. (Contributed by Raymond Hettinger.)
\item Three new functions, \function{getpgid()}, \function{killpg()},
and \function{mknod()}, were added to the \module{posix} module that
underlies the \module{os} module. (Contributed by Gustavo Niemeyer
and Geert Jansen.)
\item The \module{socket} module now supports timeouts. You
can call the \method{settimeout(\var{t})} method on a socket object to
set a timeout of \var{t} seconds. Subsequent socket operations that
take longer than \var{t} seconds to complete will abort and raise a
\exception{socket.error} exception.
Modifying \file{sample.h} would then cause the module to be recompiled.
(Contributed by Jeremy Hylton.)
(The original timeout implementation was by Tim O'Malley. Michael
Gilfix integrated it into the Python \module{socket} module, after the
patch had undergone a lengthy review. After it was checked in, Guido
van~Rossum rewrote parts of it. This is a good example of the free
software development process.)
\item Two new binary packagers were added to the Distutils.
\code{bdist_pkgtool} builds \file{.pkg} files to use with Solaris
\program{pkgtool}, and \code{bdist_sdux} builds \program{swinstall}
packages for use on HP-UX.
An abstract binary packager class,
\module{distutils.command.bdist_packager}, was added; this may make it
easier to write binary packaging commands. (Contributed by Mark
Alexander.)
\item The \module{getopt} module gained a new function,
\function{gnu_getopt()}, that supports the same arguments as the existing
......@@ -769,38 +745,6 @@ example:
(Contributed by Peter \AA{strand}.)
\item Two new binary packagers were added to the Distutils.
\code{bdist_pkgtool} builds \file{.pkg} files to use with Solaris
\program{pkgtool}, and \code{bdist_sdux} builds \program{swinstall}
packages for use on HP-UX.
An abstract binary packager class,
\module{distutils.command.bdist_packager}, was added; this may make it
easier to write binary packaging commands. (Contributed by Mark
Alexander.)
\item The Distutils \class{Extension} class now supports
an extra constructor argument named \samp{depends} for listing
additional source files that an extension depends on. This lets
Distutils recompile the module if any of the dependency files are
modified. For example, if \samp{sampmodule.c} includes the header
file \file{sample.h}, you would create the \class{Extension} object like
this:
\begin{verbatim}
ext = Extension("samp",
sources=["sampmodule.c"],
depends=["sample.h"])
\end{verbatim}
Modifying \file{sample.h} would then cause the module to be recompiled.
(Contributed by Jeremy Hylton.)
\item The \module{array} module now supports arrays of Unicode
characters using the \samp{u} format character. Arrays also now
support using the \code{+=} assignment operator to add another array's
contents, and the \code{*=} assignment operator to repeat an array.
(Contributed by Jason Orendorff.)
\item The \module{grp}, \module{pwd}, and \module{resource} modules
now return enhanced tuples:
......@@ -811,6 +755,25 @@ now return enhanced tuples:
('amk', 500)
\end{verbatim}
\item Two new functions in the \module{math} module,
\function{degrees(\var{rads})} and \function{radians(\var{degs})},
convert between radians and degrees. Other functions in the
\module{math} module such as
\function{math.sin()} and \function{math.cos()} have always required
input values measured in radians. (Contributed by Raymond Hettinger.)
\item Three new functions, \function{getpgid()}, \function{killpg()},
and \function{mknod()}, were added to the \module{posix} module that
underlies the \module{os} module. (Contributed by Gustavo Niemeyer
and Geert Jansen.)
\item The parser objects provided by the \module{pyexpat} module
can now optionally buffer character data, resulting in fewer calls to
your character data handler and therefore faster performance. Setting
the parser object's \member{buffer_text} attribute to \constant{True}
will enable buffering.
\item The \module{readline} module also gained a number of new
functions: \function{get_history_item()},
\function{get_current_history_length()}, and \function{redisplay()}.
......@@ -821,17 +784,58 @@ to the \module{signal} module by adding the \function{sigpending},
by the platform. These functions make it possible to avoid some previously
unavoidable race conditions.
\item The \module{socket} module now supports timeouts. You
can call the \method{settimeout(\var{t})} method on a socket object to
set a timeout of \var{t} seconds. Subsequent socket operations that
take longer than \var{t} seconds to complete will abort and raise a
\exception{socket.error} exception.
The original timeout implementation was by Tim O'Malley. Michael
Gilfix integrated it into the Python \module{socket} module, after the
patch had undergone a lengthy review. After it was checked in, Guido
van~Rossum rewrote parts of it. This is a good example of the free
software development process in action.
\item The new \module{textwrap} module contains functions for wrapping
strings containing paragraphs of text. The \function{wrap(\var{text},
\var{width})} function takes a string and returns a list containing
the text split into lines of no more than the chosen width. The
\function{fill(\var{text}, \var{width})} function returns a single
string, reformatted to fit into lines no longer than the chosen width.
(As you can guess, \function{fill()} is built on top of
\function{wrap()}. For example:
\begin{verbatim}
>>> import textwrap
>>> paragraph = "Not a whit, we defy augury: ... more text ..."
>>> textwrap.wrap(paragraph, 60)
["Not a whit, we defy augury: there's a special providence in",
"the fall of a sparrow. If it be now, 'tis not to come; if it",
...]
>>> print textwrap.fill(paragraph, 35)
Not a whit, we defy augury: there's
a special providence in the fall of
a sparrow. If it be now, 'tis not
to come; if it be not to come, it
will be now; if it be not now, yet
it will come: the readiness is all.
>>>
\end{verbatim}
The module also contains a \class{TextWrapper} class that actually
implements the text wrapping strategy. Both the
\class{TextWrapper} class and the \function{wrap()} and
\function{fill()} functions support a number of additional keyword
arguments for fine-tuning the formatting; consult the module's
documentation for details.
% XXX add a link to the module docs?
(Contributed by Greg Ward.)
\item The DOM implementation
in \module{xml.dom.minidom} can now generate XML output in a
particular encoding, by specifying an optional encoding argument to
the \method{toxml()} and \method{toprettyxml()} methods of DOM nodes.
\item The parser objects provided by the \module{pyexpat} module
can now optionally buffer character data, resulting in fewer calls to
your character data handler and therefore faster performance. Setting
the parser object's \member{buffer_text} attribute to \constant{True}
will enable buffering.
\end{itemize}
......
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