summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-07-09 22:14:42 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-07-09 22:14:42 (GMT)
commit28746aba9bf636d03eb1c1c5f4550c6f2dbf5300 (patch)
tree02216272cf2d2e22496856213f9efe6e8996ce6b /Lib
parent6ec6ab02c33b1b879fef7058bcfecd4edaa66bd9 (diff)
downloadcpython-28746aba9bf636d03eb1c1c5f4550c6f2dbf5300.zip
cpython-28746aba9bf636d03eb1c1c5f4550c6f2dbf5300.tar.gz
cpython-28746aba9bf636d03eb1c1c5f4550c6f2dbf5300.tar.bz2
On 64 bit systems, int literals that use less than 64 bits are now ints
rather than longs. This also fixes the test for eval(-sys.maxint - 1).
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_compile.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index bacec35..688a02d 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -216,6 +216,21 @@ if 1:
self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 1)), int))
self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 2)), long))
+ if sys.maxint == 9223372036854775807:
+ def test_32_63_bit_values(self):
+ a = +4294967296 # 1 << 32
+ b = -4294967296 # 1 << 32
+ c = +281474976710656 # 1 << 48
+ d = -281474976710656 # 1 << 48
+ e = +4611686018427387904 # 1 << 62
+ f = -4611686018427387904 # 1 << 62
+ g = +9223372036854775807 # 1 << 63 - 1
+ h = -9223372036854775807 # 1 << 63 - 1
+
+ for variable in self.test_32_63_bit_values.func_code.co_consts:
+ if variable is not None:
+ self.assertTrue(isinstance(variable, int))
+
def test_sequence_unpacking_error(self):
# Verify sequence packing/unpacking with "or". SF bug #757818
i,j = (1, -1) or (-1, 1)