[Python-checkins] python/dist/src/Doc/whatsnew whatsnew23.tex,1.64,1.65
fdrake@users.sourceforge.net
fdrake@users.sourceforge.net
Wed, 13 Nov 2002 06:59:09 -0800
Update of /cvsroot/python/python/dist/src/Doc/whatsnew
In directory usw-pr-cvs1:/tmp/cvs-serv4100
Modified Files:
whatsnew23.tex
Log Message:
Normalize whitespace.
Fix a number of markup consistency buglets.
Index: whatsnew23.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew23.tex,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -d -r1.64 -r1.65
*** whatsnew23.tex 13 Nov 2002 13:24:41 -0000 1.64
--- whatsnew23.tex 13 Nov 2002 14:59:06 -0000 1.65
***************
*** 49,53 ****
hashable.
! As a simple example,
\begin{verbatim}
--- 49,53 ----
hashable.
! As a simple example,
\begin{verbatim}
***************
*** 64,73 ****
>>> S
Set([1, 2, 5])
! >>>
\end{verbatim}
The union and intersection of sets can be computed with the
\method{union()} and \method{intersection()} methods, or,
! alternatively, using the bitwise operators \samp{\&} and \samp{|}.
Mutable sets also have in-place versions of these methods,
\method{union_update()} and \method{intersection_update()}.
--- 64,73 ----
>>> S
Set([1, 2, 5])
! >>>
\end{verbatim}
The union and intersection of sets can be computed with the
\method{union()} and \method{intersection()} methods, or,
! alternatively, using the bitwise operators \code{\&} and \code{|}.
Mutable sets also have in-place versions of these methods,
\method{union_update()} and \method{intersection_update()}.
***************
*** 80,84 ****
>>> S1 | S2 # Alternative notation
Set([1, 2, 3, 4, 5, 6])
! >>> S1.intersection(S2)
Set([])
>>> S1 & S2 # Alternative notation
--- 80,84 ----
>>> S1 | S2 # Alternative notation
Set([1, 2, 3, 4, 5, 6])
! >>> S1.intersection(S2)
Set([])
>>> S1 & S2 # Alternative notation
***************
*** 88,92 ****
>>> S1
Set([1, 2, 3, 4, 5, 6])
! >>>
\end{verbatim}
--- 88,92 ----
>>> S1
Set([1, 2, 3, 4, 5, 6])
! >>>
\end{verbatim}
***************
*** 166,170 ****
function containing a \keyword{yield} statement is a generator
function; this is detected by Python's bytecode compiler which
! compiles the function specially as a result.
When you call a generator function, it doesn't return a single value;
--- 166,170 ----
function containing a \keyword{yield} statement is a generator
function; this is detected by Python's bytecode compiler which
! compiles the function specially as a result.
When you call a generator function, it doesn't return a single value;
***************
*** 240,244 ****
chess board so that no queen threatens another) and the Knight's Tour
(a route that takes a knight to every square of an $NxN$ chessboard
! without visiting any square twice).
The idea of generators comes from other programming languages,
--- 240,244 ----
chess board so that no queen threatens another) and the Knight's Tour
(a route that takes a knight to every square of an $NxN$ chessboard
! without visiting any square twice).
The idea of generators comes from other programming languages,
***************
*** 294,298 ****
Without such an encoding declaration, the default encoding used is
! ISO-8859-1, also known as Latin1.
The encoding declaration only affects Unicode string literals; the
--- 294,298 ----
Without such an encoding declaration, the default encoding used is
! ISO-8859-1, also known as Latin1.
The encoding declaration only affects Unicode string literals; the
***************
*** 357,365 ****
Python's file objects can now support end of line conventions other
than the one followed by the platform on which Python is running.
! Opening a file with the mode \samp{U} or \samp{rU} will open a file
for reading in universal newline mode. All three line ending
! conventions will be translated to a \samp{\e n} in the strings
returned by the various file methods such as \method{read()} and
! \method{readline()}.
Universal newline support is also used when importing modules and when
--- 357,365 ----
Python's file objects can now support end of line conventions other
than the one followed by the platform on which Python is running.
! Opening a file with the mode \code{'U'} or \code{'rU'} will open a file
for reading in universal newline mode. All three line ending
! conventions will be translated to a \character{\e n} in the strings
returned by the various file methods such as \method{read()} and
! \method{readline()}.
Universal newline support is also used when importing modules and when
***************
*** 368,378 ****
without needing to convert the line-endings.
! This feature can be disabled at compile-time by specifying
\longprogramopt{without-universal-newlines} when running Python's
! \file{configure} script.
\begin{seealso}
! \seepep{278}{Universal Newline Support}{Written
and implemented by Jack Jansen.}
--- 368,378 ----
without needing to convert the line-endings.
! This feature can be disabled at compile-time by specifying
\longprogramopt{without-universal-newlines} when running Python's
! \program{configure} script.
\begin{seealso}
! \seepep{278}{Universal Newline Support}{Written
and implemented by Jack Jansen.}
***************
*** 409,413 ****
\begin{seealso}
! \seepep{279}{The enumerate() built-in function}{Written
by Raymond D. Hettinger.}
--- 409,413 ----
\begin{seealso}
! \seepep{279}{The enumerate() built-in function}{Written
by Raymond D. Hettinger.}
***************
*** 450,454 ****
Python's Booleans were added with the primary goal of making code
clearer. For example, if you're reading a function and encounter the
! statement \code{return 1}, you might wonder whether the \samp{1}
represents a truth value, or whether it's an index, or whether it's a
coefficient that multiplies some other quantity. If the statement is
--- 450,454 ----
Python's Booleans were added with the primary goal of making code
clearer. For example, if you're reading a function and encounter the
! statement \code{return 1}, you might wonder whether the \code{1}
represents a truth value, or whether it's an index, or whether it's a
coefficient that multiplies some other quantity. If the statement is
***************
*** 480,484 ****
alternative ways to spell the integer values 1 and 0, with the single
difference that \function{str()} and \function{repr()} return the
! strings \samp{True} and \samp{False} instead of \samp{1} and \samp{0}.
\begin{seealso}
--- 480,485 ----
alternative ways to spell the integer values 1 and 0, with the single
difference that \function{str()} and \function{repr()} return the
! strings \code{'True'} and \code{'False'} instead of \code{'1'} and
! \code{'0'}.
\begin{seealso}
***************
*** 518,522 ****
\begin{seealso}
! \seepep{293}{Codec Error Handling Callbacks}{Written and implemented by
Walter D\"orwald.}
--- 519,523 ----
\begin{seealso}
! \seepep{293}{Codec Error Handling Callbacks}{Written and implemented by
Walter D\"orwald.}
***************
*** 534,538 ****
types of lists, tuples, and strings have never supported this feature,
and you got a \exception{TypeError} if you tried it. Michael Hudson
! contributed a patch that was applied to Python 2.3 and fixed this
shortcoming.
--- 535,539 ----
types of lists, tuples, and strings have never supported this feature,
and you got a \exception{TypeError} if you tried it. Michael Hudson
! contributed a patch that was applied to Python 2.3 and fixed this
shortcoming.
***************
*** 639,645 ****
def __getitem__(self, item):
if isinstance(item, slice):
! return FakeSeq([self.calc_item(i)
in range(*item.indices(len(self)))])
! else:
return self.calc_item(i)
\end{verbatim}
--- 640,646 ----
def __getitem__(self, item):
if isinstance(item, slice):
! return FakeSeq([self.calc_item(i)
in range(*item.indices(len(self)))])
! else:
return self.calc_item(i)
\end{verbatim}
***************
*** 661,665 ****
described in section~\ref{section-generators} of this document.
! \item A new built-in function \function{enumerate()}
was added, as described in section~\ref{section-enumerate} of this
document.
--- 662,666 ----
described in section~\ref{section-generators} of this document.
! \item A new built-in function \function{enumerate()}
was added, as described in section~\ref{section-enumerate} of this
document.
***************
*** 669,673 ****
section~\ref{section-bool} of this document.
! \item Built-in types now support the extended slicing syntax,
as described in section~\ref{section-slices} of this document.
--- 670,674 ----
section~\ref{section-bool} of this document.
! \item Built-in types now support the extended slicing syntax,
as described in section~\ref{section-slices} of this document.
***************
*** 701,705 ****
\item The \keyword{assert} statement no longer checks the \code{__debug__}
flag, so you can no longer disable assertions by assigning to \code{__debug__}.
! Running Python with the \programopt{-O} switch will still generate
code that doesn't execute any assertions.
--- 702,706 ----
\item The \keyword{assert} statement no longer checks the \code{__debug__}
flag, so you can no longer disable assertions by assigning to \code{__debug__}.
! Running Python with the \programopt{-O} switch will still generate
code that doesn't execute any assertions.
***************
*** 721,725 ****
\end{verbatim}
! \item
A new warning, \exception{PendingDeprecationWarning} was added to
indicate features which are in the process of being
--- 722,726 ----
\end{verbatim}
! \item
A new warning, \exception{PendingDeprecationWarning} was added to
indicate features which are in the process of being
***************
*** 743,747 ****
\item One minor but far-reaching change is that the names of extension
types defined by the modules included with Python now contain the
! module and a \samp{.} in front of the type name. For example, in
Python 2.2, if you created a socket and printed its
\member{__class__}, you'd get this output:
--- 744,748 ----
\item One minor but far-reaching change is that the names of extension
types defined by the modules included with Python now contain the
! module and a \character{.} in front of the type name. For example, in
Python 2.2, if you created a socket and printed its
\member{__class__}, you'd get this output:
***************
*** 826,830 ****
(Contributed by Walter D\"orwald.)
! \item A new type object, \class{basestring}, has been added.
Both 8-bit strings and Unicode strings inherit from this type, so
\code{isinstance(obj, basestring)} will return \constant{True} for
--- 827,831 ----
(Contributed by Walter D\"orwald.)
! \item A new type object, \class{basestring}, has been added.
Both 8-bit strings and Unicode strings inherit from this type, so
\code{isinstance(obj, basestring)} will return \constant{True} for
***************
*** 879,892 ****
\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:
--- 880,893 ----
\item The \module{array} module now supports arrays of Unicode
! characters using the \character{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 \var{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 \file{sampmodule.c} includes the header
file \file{sample.h}, you would create the \class{Extension} object like
this:
***************
*** 910,914 ****
\item The \module{getopt} module gained a new function,
\function{gnu_getopt()}, that supports the same arguments as the existing
! \function{getopt()} function but uses GNU-style scanning mode.
The existing \function{getopt()} stops processing options as soon as a
non-option argument is encountered, but in GNU-style mode processing
--- 911,915 ----
\item The \module{getopt} module gained a new function,
\function{gnu_getopt()}, that supports the same arguments as the existing
! \function{getopt()} function but uses GNU-style scanning mode.
The existing \function{getopt()} stops processing options as soon as a
non-option argument is encountered, but in GNU-style mode processing
***************
*** 926,930 ****
\item The \module{grp}, \module{pwd}, and \module{resource} modules
! now return enhanced tuples:
\begin{verbatim}
--- 927,931 ----
\item The \module{grp}, \module{pwd}, and \module{resource} modules
! now return enhanced tuples:
\begin{verbatim}
***************
*** 982,988 ****
(Contributed by Kevin O'Connor.)
! \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
--- 983,989 ----
(Contributed by Kevin O'Connor.)
! \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
***************
*** 995,1002 ****
(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.
--- 996,1003 ----
(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.
***************
*** 1040,1044 ****
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
--- 1041,1045 ----
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
***************
*** 1048,1052 ****
software development process in action.
! \item The value of the C \constant{PYTHON_API_VERSION} macro is now exposed
at the Python level as \code{sys.api_version}.
--- 1049,1053 ----
software development process in action.
! \item The value of the C \constant{PYTHON_API_VERSION} macro is now exposed
at the Python level as \code{sys.api_version}.
***************
*** 1064,1069 ****
>>> 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)
--- 1065,1070 ----
>>> 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)
***************
*** 1074,1091 ****
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 \module{time} module's \function{strptime()} function has
! long been an annoyance because it uses the platform C library's
\function{strptime()} implementation, and different platforms
sometimes have odd bugs. Brett Cannon contributed a portable
--- 1075,1092 ----
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 \module{time} module's \function{strptime()} function has
! long been an annoyance because it uses the platform C library's
\function{strptime()} implementation, and different platforms
sometimes have odd bugs. Brett Cannon contributed a portable
***************
*** 1191,1195 ****
both extension modules and in the interpreter itself. To enable this
support, turn on the Python interpreter's debugging code by running
! \program{configure} with \longprogramopt{with-pydebug}.
To aid extension writers, a header file \file{Misc/pymemcompat.h} is
--- 1192,1196 ----
both extension modules and in the interpreter itself. To enable this
support, turn on the Python interpreter's debugging code by running
! \program{configure} with \longprogramopt{with-pydebug}.
To aid extension writers, a header file \file{Misc/pymemcompat.h} is
***************
*** 1247,1251 ****
\item Python can now optionally be built as a shared library
(\file{libpython2.3.so}) by supplying \longprogramopt{enable-shared}
! when running Python's \file{configure} script. (Contributed by Ondrej
Palkovsky.)
--- 1248,1252 ----
\item Python can now optionally be built as a shared library
(\file{libpython2.3.so}) by supplying \longprogramopt{enable-shared}
! when running Python's \program{configure} script. (Contributed by Ondrej
Palkovsky.)
***************
*** 1257,1263 ****
macros.
! \item The interpreter can be compiled without any docstrings for
the built-in functions and modules by supplying
! \longprogramopt{without-doc-strings} to the \file{configure} script.
This makes the Python executable about 10\% smaller, but will also
mean that you can't get help for Python's built-ins. (Contributed by
--- 1258,1264 ----
macros.
! \item The interpreter can be compiled without any docstrings for
the built-in functions and modules by supplying
! \longprogramopt{without-doc-strings} to the \program{configure} script.
This makes the Python executable about 10\% smaller, but will also
mean that you can't get help for Python's built-ins. (Contributed by
***************
*** 1267,1289 ****
has proven to be stable, so it's now being made mandatory; you can no
longer compile Python without it, and the
! \longprogramopt{with-cycle-gc} switch to \file{configure} has been removed.
\item The \cfunction{PyArg_NoArgs()} macro is now deprecated, and code
that uses it should be changed. For Python 2.2 and later, the method
definition table can specify the
! \constant{METH_NOARGS} flag, signalling that there are no arguments, and
the argument checking can then be removed. If compatibility with
pre-2.2 versions of Python is important, the code could use
! \code{PyArg_ParseTuple(args, "")} instead, but this will be slower
than using \constant{METH_NOARGS}.
\item A new function, \cfunction{PyObject_DelItemString(\var{mapping},
char *\var{key})} was added
! as shorthand for
\code{PyObject_DelItem(\var{mapping}, PyString_New(\var{key})}.
\item File objects now manage their internal string buffer
! differently by increasing it exponentially when needed.
! This results in the benchmark tests in \file{Lib/test/test_bufio.py}
speeding up from 57 seconds to 1.7 seconds, according to one
measurement.
--- 1268,1290 ----
has proven to be stable, so it's now being made mandatory; you can no
longer compile Python without it, and the
! \longprogramopt{with-cycle-gc} switch to \program{configure} has been removed.
\item The \cfunction{PyArg_NoArgs()} macro is now deprecated, and code
that uses it should be changed. For Python 2.2 and later, the method
definition table can specify the
! \constant{METH_NOARGS} flag, signalling that there are no arguments, and
the argument checking can then be removed. If compatibility with
pre-2.2 versions of Python is important, the code could use
! \code{PyArg_ParseTuple(args, "")} instead, but this will be slower
than using \constant{METH_NOARGS}.
\item A new function, \cfunction{PyObject_DelItemString(\var{mapping},
char *\var{key})} was added
! as shorthand for
\code{PyObject_DelItem(\var{mapping}, PyString_New(\var{key})}.
\item File objects now manage their internal string buffer
! differently by increasing it exponentially when needed.
! This results in the benchmark tests in \file{Lib/test/test_bufio.py}
speeding up from 57 seconds to 1.7 seconds, according to one
measurement.
***************
*** 1296,1300 ****
\item Python now includes a copy of the Expat XML parser's source code,
removing any dependence on a system version or local installation of
! Expat.
\end{itemize}
--- 1297,1301 ----
\item Python now includes a copy of the Expat XML parser's source code,
removing any dependence on a system version or local installation of
! Expat.
\end{itemize}
***************
*** 1374,1382 ****
\item Using \code{None} as a variable name will now result in a
! \exception{SyntaxWarning} warning.
\item Names of extension types defined by the modules included with
! Python now contain the module and a \samp{.} in front of the type
! name.
\item For strings \var{X} and \var{Y}, \code{\var{X} in \var{Y}} now works
--- 1375,1383 ----
\item Using \code{None} as a variable name will now result in a
! \exception{SyntaxWarning} warning.
\item Names of extension types defined by the modules included with
! Python now contain the module and a \character{.} in front of the type
! name.
\item For strings \var{X} and \var{Y}, \code{\var{X} in \var{Y}} now works
***************
*** 1384,1388 ****
\item The Distutils \function{setup()} function has gained various new
! keyword arguments such as \samp{depends}. Old versions of the
Distutils will abort if passed unknown keywords. The fix is to check
for the presence of the new \function{get_distutil_options()} function
--- 1385,1389 ----
\item The Distutils \function{setup()} function has gained various new
! keyword arguments such as \var{depends}. Old versions of the
Distutils will abort if passed unknown keywords. The fix is to check
for the presence of the new \function{get_distutil_options()} function
***************
*** 1396,1400 ****
if hasattr(core, 'get_distutil_options'):
kw['depends'] = ['foo.h']
! ext = Extension(**kw)
\end{verbatim}
--- 1397,1401 ----
if hasattr(core, 'get_distutil_options'):
kw['depends'] = ['foo.h']
! ext = Extension(**kw)
\end{verbatim}