summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-04-21 16:44:05 (GMT)
committerThomas Wouters <thomas@python.org>2006-04-21 16:44:05 (GMT)
commitd4ec0c3e2cbf76fe59c2f2a172fdcac09b3018ff (patch)
treecbb873ade20466ec7aef5e210428af8a6f929c37 /Doc
parent13247bfc8bd35cedcb44a3a8ec9d89e7c1a9f7ef (diff)
downloadcpython-d4ec0c3e2cbf76fe59c2f2a172fdcac09b3018ff.zip
cpython-d4ec0c3e2cbf76fe59c2f2a172fdcac09b3018ff.tar.gz
cpython-d4ec0c3e2cbf76fe59c2f2a172fdcac09b3018ff.tar.bz2
Merge with trunk up to revision 45620.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/howto/unicode.rst1
-rw-r--r--Doc/lib/libcodecs.tex64
-rw-r--r--Doc/whatsnew/whatsnew25.tex114
3 files changed, 102 insertions, 77 deletions
diff --git a/Doc/howto/unicode.rst b/Doc/howto/unicode.rst
index dac5c74..0946bdc 100644
--- a/Doc/howto/unicode.rst
+++ b/Doc/howto/unicode.rst
@@ -733,6 +733,7 @@ Version 1.02: posted August 16 2005. Corrects factual errors.
.. comment Additional topic: building Python w/ UCS2 or UCS4 support
.. comment Describe obscure -U switch somewhere?
+.. comment Describe use of codecs.StreamRecoder and StreamReaderWriter
.. comment
Original outline:
diff --git a/Doc/lib/libcodecs.tex b/Doc/lib/libcodecs.tex
index 8a2417e..6e0bc8d 100644
--- a/Doc/lib/libcodecs.tex
+++ b/Doc/lib/libcodecs.tex
@@ -93,21 +93,21 @@ additional functions which use \function{lookup()} for the codec
lookup:
\begin{funcdesc}{getencoder}{encoding}
-Lookup up the codec for the given encoding and return its encoder
+Look up the codec for the given encoding and return its encoder
function.
Raises a \exception{LookupError} in case the encoding cannot be found.
\end{funcdesc}
\begin{funcdesc}{getdecoder}{encoding}
-Lookup up the codec for the given encoding and return its decoder
+Look up the codec for the given encoding and return its decoder
function.
Raises a \exception{LookupError} in case the encoding cannot be found.
\end{funcdesc}
\begin{funcdesc}{getincrementalencoder}{encoding}
-Lookup up the codec for the given encoding and return its incremental encoder
+Look up the codec for the given encoding and return its incremental encoder
class or factory function.
Raises a \exception{LookupError} in case the encoding cannot be found or the
@@ -116,7 +116,7 @@ codec doesn't support an incremental encoder.
\end{funcdesc}
\begin{funcdesc}{getincrementaldecoder}{encoding}
-Lookup up the codec for the given encoding and return its incremental decoder
+Look up the codec for the given encoding and return its incremental decoder
class or factory function.
Raises a \exception{LookupError} in case the encoding cannot be found or the
@@ -125,14 +125,14 @@ codec doesn't support an incremental decoder.
\end{funcdesc}
\begin{funcdesc}{getreader}{encoding}
-Lookup up the codec for the given encoding and return its StreamReader
+Look up the codec for the given encoding and return its StreamReader
class or factory function.
Raises a \exception{LookupError} in case the encoding cannot be found.
\end{funcdesc}
\begin{funcdesc}{getwriter}{encoding}
-Lookup up the codec for the given encoding and return its StreamWriter
+Look up the codec for the given encoding and return its StreamWriter
class or factory function.
Raises a \exception{LookupError} in case the encoding cannot be found.
@@ -353,7 +353,7 @@ incremental encoder/decoder. The incremental encoder/decoder keeps track of
the encoding/decoding process during method calls.
The joined output of calls to the \method{encode}/\method{decode} method is the
-same as if the all single inputs where joined into one, and this input was
+same as if all the single inputs were joined into one, and this input was
encoded/decoded with the stateless encoder/decoder.
@@ -363,7 +363,7 @@ encoded/decoded with the stateless encoder/decoder.
The \class{IncrementalEncoder} class is used for encoding an input in multiple
steps. It defines the following methods which every incremental encoder must
-define in order to be compatible to the Python codec registry.
+define in order to be compatible with the Python codec registry.
\begin{classdesc}{IncrementalEncoder}{\optional{errors}}
Constructor for a \class{IncrementalEncoder} instance.
@@ -410,7 +410,7 @@ define in order to be compatible to the Python codec registry.
The \class{IncrementalDecoder} class is used for decoding an input in multiple
steps. It defines the following methods which every incremental decoder must
-define in order to be compatible to the Python codec registry.
+define in order to be compatible with the Python codec registry.
\begin{classdesc}{IncrementalDecoder}{\optional{errors}}
Constructor for a \class{IncrementalDecoder} instance.
@@ -456,15 +456,15 @@ define in order to be compatible to the Python codec registry.
The \class{StreamWriter} and \class{StreamReader} classes provide
generic working interfaces which can be used to implement new
-encodings submodules very easily. See \module{encodings.utf_8} for an
-example on how this is done.
+encoding submodules very easily. See \module{encodings.utf_8} for an
+example of how this is done.
\subsubsection{StreamWriter Objects \label{stream-writer-objects}}
The \class{StreamWriter} class is a subclass of \class{Codec} and
defines the following methods which every stream writer must define in
-order to be compatible to the Python codec registry.
+order to be compatible with the Python codec registry.
\begin{classdesc}{StreamWriter}{stream\optional{, errors}}
Constructor for a \class{StreamWriter} instance.
@@ -473,7 +473,7 @@ order to be compatible to the Python codec registry.
free to add additional keyword arguments, but only the ones defined
here are used by the Python codec registry.
- \var{stream} must be a file-like object open for writing (binary)
+ \var{stream} must be a file-like object open for writing binary
data.
The \class{StreamWriter} may implement different error handling
@@ -512,19 +512,19 @@ order to be compatible to the Python codec registry.
Flushes and resets the codec buffers used for keeping state.
Calling this method should ensure that the data on the output is put
- into a clean state, that allows appending of new fresh data without
+ into a clean state that allows appending of new fresh data without
having to rescan the whole stream to recover state.
\end{methoddesc}
In addition to the above methods, the \class{StreamWriter} must also
-inherit all other methods and attribute from the underlying stream.
+inherit all other methods and attributes from the underlying stream.
\subsubsection{StreamReader Objects \label{stream-reader-objects}}
The \class{StreamReader} class is a subclass of \class{Codec} and
defines the following methods which every stream reader must define in
-order to be compatible to the Python codec registry.
+order to be compatible with the Python codec registry.
\begin{classdesc}{StreamReader}{stream\optional{, errors}}
Constructor for a \class{StreamReader} instance.
@@ -589,20 +589,20 @@ order to be compatible to the Python codec registry.
\var{size}, if given, is passed as size argument to the stream's
\method{readline()} method.
- If \var{keepends} is false lineends will be stripped from the
+ If \var{keepends} is false line-endings will be stripped from the
lines returned.
\versionchanged[\var{keepends} argument added]{2.4}
\end{methoddesc}
\begin{methoddesc}{readlines}{\optional{sizehint\optional{, keepends}}}
- Read all lines available on the input stream and return them as list
+ Read all lines available on the input stream and return them as a list
of lines.
- Line breaks are implemented using the codec's decoder method and are
+ Line-endings are implemented using the codec's decoder method and are
included in the list entries if \var{keepends} is true.
- \var{sizehint}, if given, is passed as \var{size} argument to the
+ \var{sizehint}, if given, is passed as the \var{size} argument to the
stream's \method{read()} method.
\end{methoddesc}
@@ -614,7 +614,7 @@ order to be compatible to the Python codec registry.
\end{methoddesc}
In addition to the above methods, the \class{StreamReader} must also
-inherit all other methods and attribute from the underlying stream.
+inherit all other methods and attributes from the underlying stream.
The next two base classes are included for convenience. They are not
needed by the codec registry, but may provide useful in practice.
@@ -640,7 +640,7 @@ the \function{lookup()} function to construct the instance.
\class{StreamReaderWriter} instances define the combined interfaces of
\class{StreamReader} and \class{StreamWriter} classes. They inherit
-all other methods and attribute from the underlying stream.
+all other methods and attributes from the underlying stream.
\subsubsection{StreamRecoder Objects \label{stream-recoder-objects}}
@@ -666,14 +666,14 @@ the \function{lookup()} function to construct the instance.
\var{stream} must be a file-like object.
\var{encode}, \var{decode} must adhere to the \class{Codec}
- interface, \var{Reader}, \var{Writer} must be factory functions or
+ interface. \var{Reader}, \var{Writer} must be factory functions or
classes providing objects of the \class{StreamReader} and
\class{StreamWriter} interface respectively.
\var{encode} and \var{decode} are needed for the frontend
translation, \var{Reader} and \var{Writer} for the backend
translation. The intermediate format used is determined by the two
- sets of codecs, e.g. the Unicode codecs will use Unicode as
+ sets of codecs, e.g. the Unicode codecs will use Unicode as the
intermediate encoding.
Error handling is done in the same way as defined for the
@@ -682,7 +682,7 @@ the \function{lookup()} function to construct the instance.
\class{StreamRecoder} instances define the combined interfaces of
\class{StreamReader} and \class{StreamWriter} classes. They inherit
-all other methods and attribute from the underlying stream.
+all other methods and attributes from the underlying stream.
\subsection{Encodings and Unicode\label{encodings-overview}}
@@ -695,7 +695,7 @@ compiled (either via \longprogramopt{enable-unicode=ucs2} or
memory, CPU endianness and how these arrays are stored as bytes become
an issue. Transforming a unicode object into a sequence of bytes is
called encoding and recreating the unicode object from the sequence of
-bytes is known as decoding. There are many different methods how this
+bytes is known as decoding. There are many different methods for how this
transformation can be done (these methods are also called encodings).
The simplest method is to map the codepoints 0-255 to the bytes
\code{0x0}-\code{0xff}. This means that a unicode object that contains
@@ -742,7 +742,7 @@ been decoded into a Unicode string; as a \samp{ZERO WIDTH NO-BREAK SPACE}
it's a normal character that will be decoded like any other.
There's another encoding that is able to encoding the full range of
-Unicode characters: UTF-8. UTF-8 is an 8bit encoding, which means
+Unicode characters: UTF-8. UTF-8 is an 8-bit encoding, which means
there are no issues with byte order in UTF-8. Each byte in a UTF-8
byte sequence consists of two parts: Marker bits (the most significant
bits) and payload bits. The marker bits are a sequence of zero to six
@@ -762,7 +762,7 @@ character):
The least significant bit of the Unicode character is the rightmost x
bit.
-As UTF-8 is an 8bit encoding no BOM is required and any \code{U+FEFF}
+As UTF-8 is an 8-bit encoding no BOM is required and any \code{U+FEFF}
character in the decoded Unicode string (even if it's the first
character) is treated as a \samp{ZERO WIDTH NO-BREAK SPACE}.
@@ -775,7 +775,7 @@ with which a UTF-8 encoding can be detected, Microsoft invented a
variant of UTF-8 (that Python 2.5 calls \code{"utf-8-sig"}) for its Notepad
program: Before any of the Unicode characters is written to the file,
a UTF-8 encoded BOM (which looks like this as a byte sequence: \code{0xef},
-\code{0xbb}, \code{0xbf}) is written. As it's rather improbably that any
+\code{0xbb}, \code{0xbf}) is written. As it's rather improbable that any
charmap encoded file starts with these byte values (which would e.g. map to
LATIN SMALL LETTER I WITH DIAERESIS \\
@@ -794,8 +794,8 @@ first three bytes in the file.
\subsection{Standard Encodings\label{standard-encodings}}
-Python comes with a number of codecs builtin, either implemented as C
-functions, or with dictionaries as mapping tables. The following table
+Python comes with a number of codecs built-in, either implemented as C
+functions or with dictionaries as mapping tables. The following table
lists the codecs by name, together with a few common aliases, and the
languages for which the encoding is likely used. Neither the list of
aliases nor the list of languages is meant to be exhaustive. Notice
@@ -1337,7 +1337,7 @@ Convert a label to Unicode, as specified in \rfc{3490}.
UTF-8 codec with BOM signature}
\declaremodule{standard}{encodings.utf-8-sig} % XXX utf_8_sig gives TeX errors
\modulesynopsis{UTF-8 codec with BOM signature}
-\moduleauthor{Walter D\"orwald}
+\moduleauthor{Walter D\"orwald}{}
\versionadded{2.5}
diff --git a/Doc/whatsnew/whatsnew25.tex b/Doc/whatsnew/whatsnew25.tex
index db6c25a..750162f 100644
--- a/Doc/whatsnew/whatsnew25.tex
+++ b/Doc/whatsnew/whatsnew25.tex
@@ -4,7 +4,6 @@
% The easy_install stuff
% Describe the pkgutil module
-% Stateful codec changes
% Fix XXX comments
% Count up the patches and bugs
@@ -35,7 +34,7 @@ rationale, refer to the PEP for a particular new feature.
%======================================================================
-\section{PEP 243: Uploading Modules to PyPI}
+\section{PEP 243: Uploading Modules to PyPI\label{pep-243}}
PEP 243 describes an HTTP-based protocol for submitting software
packages to a central archive. The Python package index at
@@ -61,7 +60,7 @@ describe what's implemented in PyPI.}
%======================================================================
-\section{PEP 308: Conditional Expressions}
+\section{PEP 308: Conditional Expressions\label{pep-308}}
For a long time, people have been requesting a way to write
conditional expressions, expressions that return value A or value B
@@ -152,7 +151,7 @@ Wouters.}
%======================================================================
-\section{PEP 309: Partial Function Application}
+\section{PEP 309: Partial Function Application\label{pep-309}}
The \module{functional} module is intended to contain tools for
functional-style programming. Currently it only contains a
@@ -214,7 +213,7 @@ Raymond Hettinger.}
%======================================================================
-\section{PEP 314: Metadata for Python Software Packages v1.1}
+\section{PEP 314: Metadata for Python Software Packages v1.1\label{pep-314}}
Some simple dependency support was added to Distutils. The
\function{setup()} function now has \code{requires}, \code{provides},
@@ -248,7 +247,7 @@ implemented by Richard Jones and Fred Drake.}
%======================================================================
-\section{PEP 328: Absolute and Relative Imports}
+\section{PEP 328: Absolute and Relative Imports\label{pep-328}}
The simpler part of PEP 328 was implemented in Python 2.4: parentheses
could now be used to enclose the names imported from a module using
@@ -342,7 +341,7 @@ form of the import statement, only the \code{from ... import} form.
%======================================================================
-\section{PEP 338: Executing Modules as Scripts}
+\section{PEP 338: Executing Modules as Scripts\label{pep-338}}
The \programopt{-m} switch added in Python 2.4 to execute a module as
a script gained a few more abilities. Instead of being implemented in
@@ -366,7 +365,7 @@ implemented by Nick Coghlan.}
%======================================================================
-\section{PEP 341: Unified try/except/finally}
+\section{PEP 341: Unified try/except/finally\label{pep-341}}
Until Python 2.5, the \keyword{try} statement came in two
flavours. You could use a \keyword{finally} block to ensure that code
@@ -412,7 +411,7 @@ implementation by Thomas Lee.}
%======================================================================
-\section{PEP 342: New Generator Features\label{section-generators}}
+\section{PEP 342: New Generator Features\label{pep-342}}
Python 2.5 adds a simple way to pass values \emph{into} a generator.
As introduced in Python 2.3, generators only produce output; once a
@@ -578,9 +577,9 @@ Sugalski.}
%======================================================================
-\section{PEP 343: The 'with' statement}
+\section{PEP 343: The 'with' statement\label{pep-343}}
-The \keyword{with} statement allows a clearer version of code that
+The '\keyword{with}' statement allows a clearer version of code that
uses \code{try...finally} blocks to ensure that clean-up code is
executed.
@@ -589,7 +588,7 @@ used. In the next section, I'll examine the implementation details
and show how to write objects called ``context managers'' and
``contexts'' for use with this statement.
-The \keyword{with} statement is a new control-flow structure whose
+The '\keyword{with}' statement is a new control-flow structure whose
basic structure is:
\begin{verbatim}
@@ -625,11 +624,11 @@ with open('/etc/passwd', 'r') as f:
\end{verbatim}
After this statement has executed, the file object in \var{f} will
-have been automatically closed at this point, even if the 'for' loop
+have been automatically closed, even if the 'for' loop
raised an exception part-way through the block.
The \module{threading} module's locks and condition variables
-also support the \keyword{with} statement:
+also support the '\keyword{with}' statement:
\begin{verbatim}
lock = threading.Lock()
@@ -658,10 +657,10 @@ with decimal.Context(prec=16):
print v1.sqrt()
\end{verbatim}
-\subsection{Writing Context Managers}
+\subsection{Writing Context Managers\label{context-managers}}
-Under the hood, the \keyword{with} statement is fairly complicated.
-Most people will only use \keyword{with} in company with
+Under the hood, the '\keyword{with}' statement is fairly complicated.
+Most people will only use '\keyword{with}' in company with
existing objects that are documented to work as context managers, and
don't need to know these details, so you can skip the following section if
you like. Authors of new context managers will need to understand the
@@ -678,7 +677,7 @@ that's a context manager, meaning that it has a
return a context object.
\item The context's \method{__enter__()} method is called.
-The value returned is assigned to \var{VAR}. If no \code{as \var{VAR}}
+The value returned is assigned to \var{VAR}. If no \code{'as \var{VAR}'}
clause is present, the value is simply discarded.
\item The code in \var{BLOCK} is executed.
@@ -690,7 +689,7 @@ with the exception's information, the same values returned by
controls whether the exception is re-raised: any false value
re-raises the exception, and \code{True} will result in suppressing it.
You'll only rarely want to suppress the exception; the
-author of the code containing the \keyword{with} statement will
+author of the code containing the '\keyword{with}' statement will
never realize anything went wrong.
\item If \var{BLOCK} didn't raise an exception,
@@ -761,7 +760,7 @@ The \method {__enter__()} method is pretty easy, having only
to start a new transaction. In this example,
the resulting cursor object would be a useful result,
so the method will return it. The user can
-then add \code{as cursor} to their \keyword{with} statement
+then add \code{as cursor} to their '\keyword{with}' statement
to bind the cursor to a variable name.
\begin{verbatim}
@@ -806,7 +805,7 @@ a simple context manager as a generator. The generator should yield
exactly one value. The code up to the \keyword{yield} will be
executed as the \method{__enter__()} method, and the value yielded
will be the method's return value that will get bound to the variable
-in the \keyword{with} statement's \keyword{as} clause, if any. The
+in the '\keyword{with}' statement's \keyword{as} clause, if any. The
code after the \keyword{yield} will be executed in the
\method{__exit__()} method. Any exception raised in the block
will be raised by the \keyword{yield} statement.
@@ -854,7 +853,7 @@ class DatabaseConnection:
There's a \function{nested(\var{mgr1}, \var{mgr2}, ...)} manager that
combines a number of context managers so you don't need to write
-nested \keyword{with} statements. This example statement does two
+nested '\keyword{with}' statements. This example statement does two
things, starting a database transaction and acquiring a thread lock:
\begin{verbatim}
@@ -880,7 +879,7 @@ with closing(urllib.urlopen('http://www.yahoo.com')) as f:
\seepep{343}{The ``with'' statement}{PEP written by Guido van~Rossum
and Nick Coghlan; implemented by Mike Bland, Guido van~Rossum, and
-Neal Norwitz. The PEP shows the code generated for a \keyword{with}
+Neal Norwitz. The PEP shows the code generated for a '\keyword{with}'
statement, which can be helpful in learning how context managers
work.}
@@ -891,7 +890,7 @@ for the \module{contextlib} module.}
%======================================================================
-\section{PEP 352: Exceptions as New-Style Classes}
+\section{PEP 352: Exceptions as New-Style Classes\label{pep-352}}
Exception classes can now be new-style classes, not just classic
classes, and the built-in \exception{Exception} class and all the
@@ -957,7 +956,7 @@ Brett Cannon and Guido van~Rossum; implemented by Brett Cannon.}
%======================================================================
-\section{PEP 353: Using ssize_t as the index type\label{section-353}}
+\section{PEP 353: Using ssize_t as the index type\label{pep-353}}
A wide-ranging change to Python's C API, using a new
\ctype{Py_ssize_t} type definition instead of \ctype{int},
@@ -1019,7 +1018,7 @@ platforms.
%======================================================================
-\section{PEP 357: The '__index__' method}
+\section{PEP 357: The '__index__' method\label{pep-357}}
The NumPy developers had a problem that could only be solved by adding
a new special method, \method{__index__}. When using slice notation,
@@ -1092,8 +1091,8 @@ print d[3], d[4] # Prints 0, 0
\end{verbatim}
\item The \function{min()} and \function{max()} built-in functions
-gained a \code{key} keyword argument analogous to the \code{key}
-argument for \method{sort()}. This argument supplies a function that
+gained a \code{key} keyword parameter analogous to the \code{key}
+argument for \method{sort()}. This parameter supplies a function that
takes a single argument and is called for every value in the list;
\function{min()}/\function{max()} will return the element with the
smallest/largest return value from this function.
@@ -1186,7 +1185,7 @@ pystone benchmark around XXX\% faster than Python 2.4.
%======================================================================
-\section{New, Improved, and Deprecated Modules}
+\section{New, Improved, and Removed Modules}
The standard library received many enhancements and bug fixes in
Python 2.5. Here's a partial list of the most notable changes, sorted
@@ -1196,13 +1195,23 @@ the SVN logs for all the details.
\begin{itemize}
-% the cPickle module no longer accepts the deprecated None option in the
-% args tuple returned by __reduce__().
-
\item The \module{audioop} module now supports the a-LAW encoding,
and the code for u-LAW encoding has been improved. (Contributed by
Lars Immisch.)
+\item The \module{codecs} module gained support for incremental
+codecs. The \function{codec.lookup()} function now
+returns a \class{CodecInfo} instance instead of a tuple.
+\class{CodecInfo} instances behave like a 4-tuple to preserve backward
+compatibility but also have the attributes \member{encode},
+\member{decode}, \member{incrementalencoder}, \member{incrementaldecoder},
+\member{streamwriter}, and \member{streamreader}. Incremental codecs
+can receive input and produce output in multiple chunks; the output is
+the same as if the entire input was fed to the non-incremental codec.
+See the \module{codecs} module documentation for details.
+(Designed and implemented by Walter D\"orwald.)
+% Patch 1436130
+
\item The \module{collections} module gained a new type,
\class{defaultdict}, that subclasses the standard \class{dict}
type. The new type mostly behaves like a dictionary but constructs a
@@ -1244,7 +1253,7 @@ method that removes the first occurrence of \var{value} in the queue,
raising \exception{ValueError} if the value isn't found.
\item New module: The \module{contextlib} module contains helper functions for use
-with the new \keyword{with} statement. See
+with the new '\keyword{with}' statement. See
section~\ref{module-contextlib} for more about this module.
(Contributed by Phillip J. Eby.)
@@ -1257,6 +1266,11 @@ which is also written in C but doesn't match the \module{profile}
module's interface, will continue to be maintained in future versions
of Python. (Contributed by Armin Rigo.)
+Also, the \module{pstats} module used to analyze the data measured by
+the profiler now supports directing the output to any file stream
+by supplying a \var{stream} argument to the \class{Stats} constructor.
+(Contributed by Skip Montanaro.)
+
\item The \module{csv} module, which parses files in
comma-separated value format, received several enhancements and a
number of bugfixes. You can now set the maximum size in bytes of a
@@ -1302,7 +1316,7 @@ to specify which generation to collect.
\item The \function{nsmallest()} and
\function{nlargest()} functions in the \module{heapq} module
-now support a \code{key} keyword argument similar to the one
+now support a \code{key} keyword parameter similar to the one
provided by the \function{min()}/\function{max()} functions
and the \method{sort()} methods. For example:
Example:
@@ -1375,14 +1389,20 @@ The \member{st_flags} member is also available, if the platform supports it.
(Contributed by Antti Louko and Diego Petten\`o.)
% (Patch 1180695, 1212117)
+\item The \module{pickle} and \module{cPickle} modules no
+longer accept a return value of \code{None} from the
+\method{__reduce__()} method; the method must return a tuple of
+arguments instead. The ability to return \code{None} was deprecated
+in Python 2.4, so this completes the removal of the feature.
+
\item The old \module{regex} and \module{regsub} modules, which have been
deprecated ever since Python 2.0, have finally been deleted.
Other deleted modules: \module{statcache}, \module{tzparse},
\module{whrandom}.
-\item The \file{lib-old} directory,
+\item Also deleted: the \file{lib-old} directory,
which includes ancient modules such as \module{dircmp} and
-\module{ni}, was also deleted. \file{lib-old} wasn't on the default
+\module{ni}, was removed. \file{lib-old} wasn't on the default
\code{sys.path}, so unless your programs explicitly added the directory to
\code{sys.path}, this removal shouldn't affect your code.
@@ -1824,7 +1844,7 @@ Changes to Python's build process and to the C API include:
\item The largest change to the C API came from \pep{353},
which modifies the interpreter to use a \ctype{Py_ssize_t} type
definition instead of \ctype{int}. See the earlier
-section~\ref{section-353} for a discussion of this change.
+section~\ref{pep-353} for a discussion of this change.
\item The design of the bytecode compiler has changed a great deal, to
no longer generate bytecode by traversing the parse tree. Instead
@@ -1969,19 +1989,23 @@ a syntax error if a module contains string literals with 8-bit
characters but doesn't have an encoding declaration. In Python 2.4
this triggered a warning, not a syntax error.
-\item The \module{pickle} module no longer uses the deprecated \var{bin} parameter.
-
\item Previously, the \member{gi_frame} attribute of a generator
was always a frame object. Because of the \pep{342} changes
-described in section~\ref{section-generators}, it's now possible
+described in section~\ref{pep-342}, it's now possible
for \member{gi_frame} to be \code{None}.
+
+\item Library: The \module{pickle} and \module{cPickle} modules no
+longer accept a return value of \code{None} from the
+\method{__reduce__()} method; the method must return a tuple of
+arguments instead. The modules also no longer accept the deprecated
+\var{bin} keyword parameter.
+
\item C API: Many functions now use \ctype{Py_ssize_t}
-instead of \ctype{int} to allow processing more data
-on 64-bit machines. Extension code may need to make
-the same change to avoid warnings and to support 64-bit machines.
-See the earlier
-section~\ref{section-353} for a discussion of this change.
+instead of \ctype{int} to allow processing more data on 64-bit
+machines. Extension code may need to make the same change to avoid
+warnings and to support 64-bit machines. See the earlier
+section~\ref{pep-353} for a discussion of this change.
\item C API:
The obmalloc changes mean that