summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2006-08-09 13:03:41 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2006-08-09 13:03:41 (GMT)
commitb71366081fef1620de3633804d38d17551eb49f5 (patch)
tree5e2197a3389987ef7330b578d50cd19e46c0abd7 /Doc
parentab2f8f7bd556c16a2b30aa8ec05d4c9d8c50d311 (diff)
downloadcpython-b71366081fef1620de3633804d38d17551eb49f5.zip
cpython-b71366081fef1620de3633804d38d17551eb49f5.tar.gz
cpython-b71366081fef1620de3633804d38d17551eb49f5.tar.bz2
[Bug #1536021] Mention __hash__ change
Diffstat (limited to 'Doc')
-rw-r--r--Doc/whatsnew/whatsnew25.tex12
1 files changed, 10 insertions, 2 deletions
diff --git a/Doc/whatsnew/whatsnew25.tex b/Doc/whatsnew/whatsnew25.tex
index 132f3a2..1e73633 100644
--- a/Doc/whatsnew/whatsnew25.tex
+++ b/Doc/whatsnew/whatsnew25.tex
@@ -3,7 +3,6 @@
% $Id$
% Fix XXX comments
-% Count up the patches and bugs
\title{What's New in Python 2.5}
\release{0.9}
@@ -1100,10 +1099,10 @@ print d[3], d[4] # Prints 0, 0
\item Both 8-bit and Unicode strings have new \method{partition(sep)}
and \method{rpartition(sep)} methods that simplify a common use case.
+
The \method{find(S)} method is often used to get an index which is
then used to slice the string and obtain the pieces that are before
and after the separator.
-
\method{partition(sep)} condenses this
pattern into a single method call that returns a 3-tuple containing
the substring before the separator, the separator itself, and the
@@ -1165,6 +1164,15 @@ returned by the iterator is true; otherwise it will return
all of the values returned by the iterator evaluate as true.
(Suggested by Guido van~Rossum, and implemented by Raymond Hettinger.)
+\item The result of a class's \method{__hash__()} method can now
+be either a long integer or a regular integer. If a long integer is
+returned, the hash of that value is taken. In earlier versions the
+hash value was required to be a regular integer, but in 2.5 the
+\function{id()} built-in was changed to always return non-negative
+numbers, and users often seem to use \code{id(self)} in
+\method{__hash__()} methods (though this is discouraged).
+% Bug #1536021
+
\item ASCII is now the default encoding for modules. It's now
a syntax error if a module contains string literals with 8-bit
characters but doesn't have an encoding declaration. In Python 2.4