summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew/whatsnew25.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/whatsnew/whatsnew25.tex')
-rw-r--r--Doc/whatsnew/whatsnew25.tex22
1 files changed, 14 insertions, 8 deletions
diff --git a/Doc/whatsnew/whatsnew25.tex b/Doc/whatsnew/whatsnew25.tex
index 5bee789..4015d98 100644
--- a/Doc/whatsnew/whatsnew25.tex
+++ b/Doc/whatsnew/whatsnew25.tex
@@ -1166,12 +1166,13 @@ In 2.5 the internal data structure has been customized for implementing sets,
and as a result sets will use a third less memory and are somewhat faster.
(Implemented by Raymond Hettinger.)
-\item The speed of some Unicode operations, such as
-finding substrings, string splitting, and character map decoding, has
-been improved. (Substring search and splitting improvements were
+\item The speed of some Unicode operations, such as finding
+substrings, string splitting, and character map encoding and decoding,
+has been improved. (Substring search and splitting improvements were
added by Fredrik Lundh and Andrew Dalke at the NeedForSpeed
-sprint. Character map decoding was improved by Walter D\"orwald.)
-% Patch 1313939
+sprint. Character maps were improved by Walter D\"orwald and
+Martin von~L\"owis.)
+% Patch 1313939, 1359618
\item The \function{long(\var{str}, \var{base})} function is now
faster on long digit strings because fewer intermediate results are
@@ -1185,6 +1186,11 @@ strings into an internal representation and caches this
representation, yielding a 20\% speedup. (Contributed by Bob Ippolito
at the NeedForSpeed sprint.)
+\item The \module{re} module got a 1 or 2\% speedup by switching to
+Python's allocator functions instead of the system's
+\cfunction{malloc()} and \cfunction{free()}.
+(Contributed by Jack Diederich at the NeedForSpeed sprint.)
+
\item The code generator's peephole optimizer now performs
simple constant folding in expressions. If you write something like
\code{a = 2+3}, the code generator will do the arithmetic and produce
@@ -1358,7 +1364,6 @@ to specify which generation to collect.
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:
\begin{verbatim}
>>> import heapq
@@ -1923,10 +1928,11 @@ variables. You shouldn't assemble your query using Python's string
operations because doing so is insecure; it makes your program
vulnerable to an SQL injection attack.
-Instead, use SQLite's parameter substitution. Put \samp{?} as a
+Instead, use the DB-API's parameter substitution. Put \samp{?} as a
placeholder wherever you want to use a value, and then provide a tuple
of values as the second argument to the cursor's \method{execute()}
-method. For example:
+method. (Other database modules may use a different placeholder,
+such as \samp{\%s} or \samp{:1}.) For example:
\begin{verbatim}
# Never do this -- insecure!