summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-09-04 05:14:19 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-09-04 05:14:19 (GMT)
commit9fffa3eea3a7e99b0179988e7a016a45bf63ab96 (patch)
tree1b891e323dff2790bcd2b74ad4071cb0d380803d /Misc/NEWS
parent1832de4bc07e7ffd5938b41e8d7d8fcf8b5e12e2 (diff)
downloadcpython-9fffa3eea3a7e99b0179988e7a016a45bf63ab96.zip
cpython-9fffa3eea3a7e99b0179988e7a016a45bf63ab96.tar.gz
cpython-9fffa3eea3a7e99b0179988e7a016a45bf63ab96.tar.bz2
Raise OverflowError when appropriate on long->float conversion. Most of
the fiddling is simply due to that no caller of PyLong_AsDouble ever checked for failure (so that's fixing old bugs). PyLong_AsDouble is much faster for big inputs now too, but that's more of a happy consequence than a design goal.
Diffstat (limited to 'Misc/NEWS')
-rw-r--r--Misc/NEWS12
1 files changed, 12 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 43eff32..a8f05c7 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -3,6 +3,9 @@ What's New in Python 2.2a3?
Core
+- Conversion of long to float now raises OverflowError if the long is too
+ big to represent as a C double.
+
- The 3-argument builtin pow() no longer allows a third non-None argument
if either of the first two arguments is a float, or if both are of
integer types and the second argument is negative (in which latter case
@@ -95,6 +98,15 @@ Build
API
+- Note that PyLong_AsDouble can fail! This has always been true, but no
+ callers checked for it. It's more likely to fail now, because overflow
+ errors are properly detected now. The proper way to check:
+
+ double x = PyLong_AsDouble(some_long_object);
+ if (x == -1.0 && PyErr_Occurred()) {
+ /* The conversion failed. */
+ }
+
- The GC API has been changed. Extensions that use the old API will still
compile but will not participate in GC. To upgrade an extension
module: