Fred Drake | 2db7680 | 2004-12-01 05:05:47 +0000 | [diff] [blame] | 1 | \documentclass{howto} |
| 2 | \usepackage{distutils} |
| 3 | % $Id$ |
| 4 | |
Fred Drake | 2db7680 | 2004-12-01 05:05:47 +0000 | [diff] [blame] | 5 | |
| 6 | \title{What's New in Python 2.5} |
| 7 | \release{0.0} |
Andrew M. Kuchling | 92e2495 | 2004-12-03 13:54:09 +0000 | [diff] [blame] | 8 | \author{A.M. Kuchling} |
| 9 | \authoraddress{\email{amk@amk.ca}} |
Fred Drake | 2db7680 | 2004-12-01 05:05:47 +0000 | [diff] [blame] | 10 | |
| 11 | \begin{document} |
| 12 | \maketitle |
| 13 | \tableofcontents |
| 14 | |
| 15 | This article explains the new features in Python 2.5. No release date |
Andrew M. Kuchling | 92e2495 | 2004-12-03 13:54:09 +0000 | [diff] [blame] | 16 | for Python 2.5 has been set; it will probably be released in late 2005. |
Fred Drake | 2db7680 | 2004-12-01 05:05:47 +0000 | [diff] [blame] | 17 | |
| 18 | % Compare with previous release in 2 - 3 sentences here. |
| 19 | |
| 20 | This article doesn't attempt to provide a complete specification of |
| 21 | the new features, but instead provides a convenient overview. For |
| 22 | full details, you should refer to the documentation for Python 2.5. |
| 23 | % add hyperlink when the documentation becomes available online. |
| 24 | If you want to understand the complete implementation and design |
| 25 | rationale, 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 | |
| 36 | Here are all of the changes that Python 2.5 makes to the core Python |
| 37 | language. |
| 38 | |
| 39 | \begin{itemize} |
Andrew M. Kuchling | 1cae3f5 | 2004-12-03 14:57:21 +0000 | [diff] [blame] | 40 | |
| 41 | \item The \function{min()} and \function{max()} built-in functions |
| 42 | gained a \code{key} keyword argument analogous to the \code{key} |
| 43 | argument for \function{sort()}. This argument supplies a function |
| 44 | that takes a single argument and is called for every value in the list; |
| 45 | \function{min()}/\function{max()} will return the element with the |
| 46 | smallest/largest return value from this function. |
| 47 | For example, to find the longest string in a list, you can do: |
| 48 | |
| 49 | \begin{verbatim} |
| 50 | L = ['medium', 'longest', 'short'] |
| 51 | # Prints 'longest' |
| 52 | print max(L, key=len) |
| 53 | # Prints 'short', because lexicographically 'short' has the largest value |
| 54 | print max(L) |
| 55 | \end{verbatim} |
| 56 | |
| 57 | (Contributed by Steven Bethard and Raymond Hettinger.) |
Fred Drake | 2db7680 | 2004-12-01 05:05:47 +0000 | [diff] [blame] | 58 | |
| 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 | |
| 71 | The net result of the 2.5 optimizations is that Python 2.5 runs the |
Andrew M. Kuchling | 92e2495 | 2004-12-03 13:54:09 +0000 | [diff] [blame] | 72 | pystone benchmark around XX\% faster than Python 2.4. |
Fred Drake | 2db7680 | 2004-12-01 05:05:47 +0000 | [diff] [blame] | 73 | |
| 74 | |
| 75 | %====================================================================== |
| 76 | \section{New, Improved, and Deprecated Modules} |
| 77 | |
| 78 | As usual, Python's standard library received a number of enhancements and |
| 79 | bug fixes. Here's a partial list of the most notable changes, sorted |
| 80 | alphabetically by module name. Consult the |
| 81 | \file{Misc/NEWS} file in the source tree for a more |
| 82 | complete list of changes, or look through the CVS logs for all the |
| 83 | details. |
| 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 | |
| 99 | Changes to Python's build process and to the C API include: |
| 100 | |
| 101 | \begin{itemize} |
| 102 | |
Andrew M. Kuchling | 2238fc6 | 2004-12-03 15:16:40 +0000 | [diff] [blame^] | 103 | \item The \cfunction{PyRange_New()} function was removed. It was never documented, |
| 104 | never used in the core code, and had dangerously lax error checking. |
Fred Drake | 2db7680 | 2004-12-01 05:05:47 +0000 | [diff] [blame] | 105 | |
| 106 | \end{itemize} |
| 107 | |
| 108 | |
| 109 | %====================================================================== |
| 110 | \subsection{Port-Specific Changes} |
| 111 | |
| 112 | Platform-specific changes go here. |
| 113 | |
| 114 | |
| 115 | %====================================================================== |
| 116 | \section{Other Changes and Fixes \label{section-other}} |
| 117 | |
| 118 | As usual, there were a bunch of other improvements and bugfixes |
| 119 | scattered throughout the source tree. A search through the CVS change |
| 120 | logs finds there were XXX patches applied and YYY bugs fixed between |
Andrew M. Kuchling | 92e2495 | 2004-12-03 13:54:09 +0000 | [diff] [blame] | 121 | Python 2.4 and 2.5. Both figures are likely to be underestimates. |
Fred Drake | 2db7680 | 2004-12-01 05:05:47 +0000 | [diff] [blame] | 122 | |
| 123 | Some 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 | |
| 135 | This section lists previously described changes that may require |
| 136 | changes 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 | |
| 148 | The author would like to thank the following people for offering |
| 149 | suggestions, corrections and assistance with various drafts of this |
| 150 | article: . |
| 151 | |
| 152 | \end{document} |