blob: b4a41bff20917ca836d40aca0883df8c86428191 [file] [log] [blame]
Fred Drake2db76802004-12-01 05:05:47 +00001\documentclass{howto}
2\usepackage{distutils}
3% $Id$
4
Fred Drake2db76802004-12-01 05:05:47 +00005
6\title{What's New in Python 2.5}
7\release{0.0}
Andrew M. Kuchling92e24952004-12-03 13:54:09 +00008\author{A.M. Kuchling}
9\authoraddress{\email{amk@amk.ca}}
Fred Drake2db76802004-12-01 05:05:47 +000010
11\begin{document}
12\maketitle
13\tableofcontents
14
15This article explains the new features in Python 2.5. No release date
Andrew M. Kuchling92e24952004-12-03 13:54:09 +000016for Python 2.5 has been set; it will probably be released in late 2005.
Fred Drake2db76802004-12-01 05:05:47 +000017
18% Compare with previous release in 2 - 3 sentences here.
19
20This article doesn't attempt to provide a complete specification of
21the new features, but instead provides a convenient overview. For
22full details, you should refer to the documentation for Python 2.5.
23% add hyperlink when the documentation becomes available online.
24If you want to understand the complete implementation and design
25rationale, refer to the PEP for a particular new feature.
26
27
28%======================================================================
29
30% Large, PEP-level features and changes should be described here.
31
32
33%======================================================================
34\section{Other Language Changes}
35
36Here are all of the changes that Python 2.5 makes to the core Python
37language.
38
39\begin{itemize}
Andrew M. Kuchling1cae3f52004-12-03 14:57:21 +000040
41\item The \function{min()} and \function{max()} built-in functions
42gained a \code{key} keyword argument analogous to the \code{key}
43argument for \function{sort()}. This argument supplies a function
44that takes a single argument and is called for every value in the list;
45\function{min()}/\function{max()} will return the element with the
46smallest/largest return value from this function.
47For example, to find the longest string in a list, you can do:
48
49\begin{verbatim}
50L = ['medium', 'longest', 'short']
51# Prints 'longest'
52print max(L, key=len)
53# Prints 'short', because lexicographically 'short' has the largest value
54print max(L)
55\end{verbatim}
56
57(Contributed by Steven Bethard and Raymond Hettinger.)
Fred Drake2db76802004-12-01 05:05:47 +000058
59\end{itemize}
60
61
62%======================================================================
63\subsection{Optimizations}
64
65\begin{itemize}
66
67\item Optimizations should be described here.
68
69\end{itemize}
70
71The net result of the 2.5 optimizations is that Python 2.5 runs the
Andrew M. Kuchling92e24952004-12-03 13:54:09 +000072pystone benchmark around XX\% faster than Python 2.4.
Fred Drake2db76802004-12-01 05:05:47 +000073
74
75%======================================================================
76\section{New, Improved, and Deprecated Modules}
77
78As usual, Python's standard library received a number of enhancements and
79bug fixes. Here's a partial list of the most notable changes, sorted
80alphabetically by module name. Consult the
81\file{Misc/NEWS} file in the source tree for a more
82complete list of changes, or look through the CVS logs for all the
83details.
84
85\begin{itemize}
86
87\item Descriptions go here.
88
89\end{itemize}
90
91
92%======================================================================
93% whole new modules get described in \subsections here
94
95
96% ======================================================================
97\section{Build and C API Changes}
98
99Changes to Python's build process and to the C API include:
100
101\begin{itemize}
102
Andrew M. Kuchling2238fc62004-12-03 15:16:40 +0000103\item The \cfunction{PyRange_New()} function was removed. It was never documented,
104never used in the core code, and had dangerously lax error checking.
Fred Drake2db76802004-12-01 05:05:47 +0000105
106\end{itemize}
107
108
109%======================================================================
110\subsection{Port-Specific Changes}
111
112Platform-specific changes go here.
113
114
115%======================================================================
116\section{Other Changes and Fixes \label{section-other}}
117
118As usual, there were a bunch of other improvements and bugfixes
119scattered throughout the source tree. A search through the CVS change
120logs finds there were XXX patches applied and YYY bugs fixed between
Andrew M. Kuchling92e24952004-12-03 13:54:09 +0000121Python 2.4 and 2.5. Both figures are likely to be underestimates.
Fred Drake2db76802004-12-01 05:05:47 +0000122
123Some of the more notable changes are:
124
125\begin{itemize}
126
127\item Details go here.
128
129\end{itemize}
130
131
132%======================================================================
133\section{Porting to Python 2.5}
134
135This section lists previously described changes that may require
136changes to your code:
137
138\begin{itemize}
139
140\item Everything is all in the details!
141
142\end{itemize}
143
144
145%======================================================================
146\section{Acknowledgements \label{acks}}
147
148The author would like to thank the following people for offering
149suggestions, corrections and assistance with various drafts of this
150article: .
151
152\end{document}