diff options
author | Christian Heimes <christian@cheimes.de> | 2007-12-04 23:02:19 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-12-04 23:02:19 (GMT) |
commit | a37d4c693a024154093b36a612810c3bd72d9254 (patch) | |
tree | d8c061b9356d7bf8f444bcfd7869c1ac5bec9f3c /Lib/test/test_compile.py | |
parent | 327858ef2c4512937a1333212a3b46a62c18ccc3 (diff) | |
download | cpython-a37d4c693a024154093b36a612810c3bd72d9254.zip cpython-a37d4c693a024154093b36a612810c3bd72d9254.tar.gz cpython-a37d4c693a024154093b36a612810c3bd72d9254.tar.bz2 |
Removed PyInt_GetMax and sys.maxint
I replaced sys.maxint with sys.maxsize in Lib/*.py. Does anybody see a problem with the change on Win 64bit platforms? Win 64's long is just 32bit but the sys.maxsize is now 2**63-1 on every 64bit platform.
Also added docs for sys.maxsize.
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r-- | Lib/test/test_compile.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index cc490d7..4979f92 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -194,24 +194,24 @@ if 1: def test_unary_minus(self): # Verify treatment of unary minus on negative numbers SF bug #660455 - if sys.maxint == 2147483647: + if sys.maxsize == 2147483647: # 32-bit machine all_one_bits = '0xffffffff' self.assertEqual(eval(all_one_bits), 4294967295) self.assertEqual(eval("-" + all_one_bits), -4294967295) - elif sys.maxint == 9223372036854775807: + elif sys.maxsize == 9223372036854775807: # 64-bit machine all_one_bits = '0xffffffffffffffff' self.assertEqual(eval(all_one_bits), 18446744073709551615) self.assertEqual(eval("-" + all_one_bits), -18446744073709551615) else: self.fail("How many bits *does* this machine have???") - # Verify treatment of contant folding on -(sys.maxint+1) + # Verify treatment of contant folding on -(sys.maxsize+1) # i.e. -2147483648 on 32 bit platforms. Should return int, not long. - self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 1)), int)) - self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 2)), int)) + self.assertTrue(isinstance(eval("%s" % (-sys.maxsize - 1)), int)) + self.assertTrue(isinstance(eval("%s" % (-sys.maxsize - 2)), int)) - if sys.maxint == 9223372036854775807: + if sys.maxsize == 9223372036854775807: def test_32_63_bit_values(self): a = +4294967296 # 1 << 32 b = -4294967296 # 1 << 32 |