Commit 97ef8de9 authored by Raymond Hettinger's avatar Raymond Hettinger

* Add various updates reflecting the last two weeks of checkins:

  timeit, base64, MSVC++ 7.1 build, METH_COEXISTS, and optimizations.

* Put in a comment suggesting an improvement to the rsplit() example.
parent 75c00efc
...@@ -149,6 +149,14 @@ the string. ...@@ -149,6 +149,14 @@ the string.
['a b', 'c'] ['a b', 'c']
\end{verbatim} \end{verbatim}
% Consider replacing the above example with one that is less
% abstract and more suggestive of why the function is useful:
%
% >>> 'www.python.org'.split('.', 1)
% ['www', 'python.org']
% >>> 'www.python.org'.rsplit('.', 1)
% ['www.python', 'org']
\item The \method{sort()} method of lists gained three keyword \item The \method{sort()} method of lists gained three keyword
arguments, \var{cmp}, \var{key}, and \var{reverse}. These arguments arguments, \var{cmp}, \var{key}, and \var{reverse}. These arguments
make some common usages of \method{sort()} simpler. All are optional. make some common usages of \method{sort()} simpler. All are optional.
...@@ -259,7 +267,18 @@ yellow 5 ...@@ -259,7 +267,18 @@ yellow 5
\begin{itemize} \begin{itemize}
\item Optimizations should be described here. \item \function{list()}, \function{tuple()}, \function{map()},
\function{filter()}, and \function{zip()} now run several times
faster with non-sequence arguments that supply a \method{__len__()}
method. Previously, the pre-sizing optimization only applied to
sequence arguments.
\item The unbound methods \method{list.__getitem__()},
\method{dict.__getitem__()}, and \method{dict.__contains__()} are
are now implemented as \class{method_descriptor} objects rather
than \class{wrapper_descriptor} objects. This form of optimized
access doubles their performance and makes them more suitable for
use as arguments to functionals: \samp{map(dict.__contains__, mydict)}.
\end{itemize} \end{itemize}
...@@ -423,13 +442,22 @@ Changes to Python's build process and to the C API include: ...@@ -423,13 +442,22 @@ Changes to Python's build process and to the C API include:
fast dictionary lookups without masking exceptions raised during the fast dictionary lookups without masking exceptions raised during the
look-up process. look-up process.
\item A new method flag, \code{METH_COEXISTS}, allows a function
defined in slots to co-exist with a PyCFunction having the same name.
This can halve the access to time to a method such as
\method{set.__contains__()}
\end{itemize} \end{itemize}
%====================================================================== %======================================================================
\subsection{Port-Specific Changes} \subsection{Port-Specific Changes}
Platform-specific changes go here. \begin{itemize}
\item The Windows port now builds under MSVC++ 7.1 as well as version 6.
\end{itemize}
%====================================================================== %======================================================================
...@@ -444,7 +472,14 @@ Some of the more notable changes are: ...@@ -444,7 +472,14 @@ Some of the more notable changes are:
\begin{itemize} \begin{itemize}
\item Details go here. \item The \module{timeit} module now automatically disables periodic
garbarge collection during the timing loop. This change makes
consecutive timings more comparable.
\item The \module{base64} module now has more complete RFC 3548 support
for Base64, Base32, and Base16 encoding and decoding, including
optional case folding and optional alternative alphabets.
(Contributed by Barry Warsaw.)
\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