Commit 2c28f3aa authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

Sort changed modules into alphabetical order; no other changes

parent 0af43ea0
...@@ -688,69 +688,45 @@ SourceForge CVS browser.} ...@@ -688,69 +688,45 @@ SourceForge CVS browser.}
\section{New and Improved Modules} \section{New and Improved Modules}
As usual, Python's standard modules had a number of enhancements and 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 bug fixes. Here's a partial list of the most notable changes, sorted
in the source tree, or the CVS logs, for a more complete list. 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} \begin{itemize}
\item The new \module{textwrap} module contains functions for wrapping \item The \module{array} module now supports arrays of Unicode
strings containing paragraphs of text. The \function{wrap(\var{text}, characters using the \samp{u} format character. Arrays also now
\var{width})} function takes a string and returns a list containing support using the \code{+=} assignment operator to add another array's
the text split into lines of no more than the chosen width. The contents, and the \code{*=} assignment operator to repeat an array.
\function{fill(\var{text}, \var{width})} function returns a single (Contributed by Jason Orendorff.)
string, reformatted to fit into lines no longer than the chosen width.
(As you can guess, \function{fill()} is built on top of \item The Distutils \class{Extension} class now supports
\function{wrap()}. For example: 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} \begin{verbatim}
>>> import textwrap ext = Extension("samp",
>>> paragraph = "Not a whit, we defy augury: ... more text ..." sources=["sampmodule.c"],
>>> textwrap.wrap(paragraph, 60) depends=["sample.h"])
["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} \end{verbatim}
The module also contains a \class{TextWrapper} class that actually Modifying \file{sample.h} would then cause the module to be recompiled.
implements the text wrapping strategy. Both the (Contributed by Jeremy Hylton.)
\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.
(The original timeout implementation was by Tim O'Malley. Michael \item Two new binary packagers were added to the Distutils.
Gilfix integrated it into the Python \module{socket} module, after the \code{bdist_pkgtool} builds \file{.pkg} files to use with Solaris
patch had undergone a lengthy review. After it was checked in, Guido \program{pkgtool}, and \code{bdist_sdux} builds \program{swinstall}
van~Rossum rewrote parts of it. This is a good example of the free packages for use on HP-UX.
software development process.) 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, \item The \module{getopt} module gained a new function,
\function{gnu_getopt()}, that supports the same arguments as the existing \function{gnu_getopt()}, that supports the same arguments as the existing
...@@ -769,38 +745,6 @@ example: ...@@ -769,38 +745,6 @@ example:
(Contributed by Peter \AA{strand}.) (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 \item The \module{grp}, \module{pwd}, and \module{resource} modules
now return enhanced tuples: now return enhanced tuples:
...@@ -811,6 +755,25 @@ now return enhanced tuples: ...@@ -811,6 +755,25 @@ now return enhanced tuples:
('amk', 500) ('amk', 500)
\end{verbatim} \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 \item The \module{readline} module also gained a number of new
functions: \function{get_history_item()}, functions: \function{get_history_item()},
\function{get_current_history_length()}, and \function{redisplay()}. \function{get_current_history_length()}, and \function{redisplay()}.
...@@ -821,17 +784,58 @@ to the \module{signal} module by adding the \function{sigpending}, ...@@ -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 by the platform. These functions make it possible to avoid some previously
unavoidable race conditions. 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 \item The DOM implementation
in \module{xml.dom.minidom} can now generate XML output in a in \module{xml.dom.minidom} can now generate XML output in a
particular encoding, by specifying an optional encoding argument to particular encoding, by specifying an optional encoding argument to
the \method{toxml()} and \method{toprettyxml()} methods of DOM nodes. 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} \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