summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-02-12 17:05:26 (GMT)
committerGuido van Rossum <guido@python.org>2003-02-12 17:05:26 (GMT)
commit48035eb45269beddfaf3339fbecc3c264c57fd84 (patch)
tree6e494faded077ac600133979c64887a98aea4237 /Misc
parent66b1259dbc2cf4aaefd779d76c4a83fe8003bafd (diff)
downloadcpython-48035eb45269beddfaf3339fbecc3c264c57fd84.zip
cpython-48035eb45269beddfaf3339fbecc3c264c57fd84.tar.gz
cpython-48035eb45269beddfaf3339fbecc3c264c57fd84.tar.bz2
SF #660455 : patch by NNorwitz.
"Unsigned" (i.e., positive-looking, but really negative) hex/oct constants with a leading minus sign are once again properly negated. The micro-optimization for negated numeric constants did the wrong thing for such hex/oct constants. The patch avoids the optimization for all hex/oct constants. This needs to be backported to Python 2.2!
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS12
1 files changed, 12 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 11521c6..8a6e902 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,18 @@ What's New in Python 2.3 alpha 2?
Core and builtins
-----------------
+- Through a bytecode optimizer bug (and I bet you didn't even know
+ Python *had* a bytecode optimizer :-), "unsigned" hex/oct constants
+ with a leading minus sign would come out with the wrong sign.
+ ("Unsigned" hex/oct constants are those with a face value in the
+ range sys.maxint+1 through sys.maxint*2+1, inclusive; these have
+ always been interpreted as negative numbers through sign folding.)
+ E.g. 0xffffffff is -1, and -(0xffffffff) is 1, but -0xffffffff would
+ come out as -4294967295. This was the case in Python 2.2 through
+ 2.2.2 and 2.3a1, and in Python 2.4 it will once again have that
+ value, but according to PEP 237 it really needs to be 1 now. This
+ will be backported to Python 2.2.3 a well. (SF #660455)
+
- super(X, x): x may now be a proxy for an X instance, i.e.
issubclass(x.__class__, X) but not issubclass(type(x), X).